diff options
Diffstat (limited to 'src/DotNetOpenAuth.Test/Messaging/ErrorUtilitiesTests.cs')
-rw-r--r-- | src/DotNetOpenAuth.Test/Messaging/ErrorUtilitiesTests.cs | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/DotNetOpenAuth.Test/Messaging/ErrorUtilitiesTests.cs b/src/DotNetOpenAuth.Test/Messaging/ErrorUtilitiesTests.cs new file mode 100644 index 0000000..36b6ae7 --- /dev/null +++ b/src/DotNetOpenAuth.Test/Messaging/ErrorUtilitiesTests.cs @@ -0,0 +1,39 @@ +//----------------------------------------------------------------------- +// <copyright file="ErrorUtilitiesTests.cs" company="Andrew Arnott"> +// Copyright (c) Andrew Arnott. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +namespace DotNetOpenAuth.Test.Messaging { + using System; + using DotNetOpenAuth.Messaging; + using Microsoft.VisualStudio.TestTools.UnitTesting; + + [TestClass] + public class ErrorUtilitiesTests { + [TestMethod, ExpectedException(typeof(ArgumentNullException))] + public void VerifyArgumentNotNullThrows() { + ErrorUtilities.VerifyArgumentNotNull(null, "someArg"); + } + + [TestMethod] + public void VerifyArgumentNotNullDoesNotThrow() { + ErrorUtilities.VerifyArgumentNotNull("hi", "someArg"); + } + + [TestMethod, ExpectedException(typeof(ArgumentNullException))] + public void VerifyNonZeroLengthOnNull() { + ErrorUtilities.VerifyNonZeroLength(null, "someArg"); + } + + [TestMethod, ExpectedException(typeof(ArgumentException))] + public void VerifyNonZeroLengthOnEmpty() { + ErrorUtilities.VerifyNonZeroLength(string.Empty, "someArg"); + } + + [TestMethod] + public void VerifyNonZeroLengthOnNonEmpty() { + ErrorUtilities.VerifyNonZeroLength("some Value", "someArg"); + } + } +} |