summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.Test/Messaging/ErrorUtilitiesTests.cs
blob: 4408708a29ed5bc49735a07d0cdf069bf2097681 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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 NUnit.Framework;

	[TestFixture]
	public class ErrorUtilitiesTests {
		[TestCase, ExpectedException(typeof(ArgumentNullException))]
		public void VerifyArgumentNotNullThrows() {
			ErrorUtilities.VerifyArgumentNotNull(null, "someArg");
		}

		[TestCase]
		public void VerifyArgumentNotNullDoesNotThrow() {
			ErrorUtilities.VerifyArgumentNotNull("hi", "someArg");
		}

		[TestCase, ExpectedException(typeof(ArgumentNullException))]
		public void VerifyNonZeroLengthOnNull() {
			ErrorUtilities.VerifyNonZeroLength(null, "someArg");
		}

		[TestCase, ExpectedException(typeof(ArgumentException))]
		public void VerifyNonZeroLengthOnEmpty() {
			ErrorUtilities.VerifyNonZeroLength(string.Empty, "someArg");
		}

		[TestCase]
		public void VerifyNonZeroLengthOnNonEmpty() {
			ErrorUtilities.VerifyNonZeroLength("some Value", "someArg");
		}
	}
}