diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2008-12-20 17:00:45 -0800 |
---|---|---|
committer | Andrew <andrewarnott@gmail.com> | 2008-12-20 17:00:45 -0800 |
commit | 9d7dcf58fe0974d0beb7ca29608827b3efdab051 (patch) | |
tree | d6a075e7f13d617634446ead1547d28faa9f5776 /src/DotNetOpenAuth.Test/Messaging/CollectionAssert.cs | |
parent | dc4051a6520311f429ba3ca97a7ae378a1f7af83 (diff) | |
download | DotNetOpenAuth-9d7dcf58fe0974d0beb7ca29608827b3efdab051.zip DotNetOpenAuth-9d7dcf58fe0974d0beb7ca29608827b3efdab051.tar.gz DotNetOpenAuth-9d7dcf58fe0974d0beb7ca29608827b3efdab051.tar.bz2 |
Simplest sreg extension test added and passing.
Diffstat (limited to 'src/DotNetOpenAuth.Test/Messaging/CollectionAssert.cs')
-rw-r--r-- | src/DotNetOpenAuth.Test/Messaging/CollectionAssert.cs | 45 |
1 files changed, 26 insertions, 19 deletions
diff --git a/src/DotNetOpenAuth.Test/Messaging/CollectionAssert.cs b/src/DotNetOpenAuth.Test/Messaging/CollectionAssert.cs index d06ef62..1cdefdb 100644 --- a/src/DotNetOpenAuth.Test/Messaging/CollectionAssert.cs +++ b/src/DotNetOpenAuth.Test/Messaging/CollectionAssert.cs @@ -1,19 +1,26 @@ -//----------------------------------------------------------------------- -// <copyright file="CollectionAssert.cs" company="Andrew Arnott"> -// Copyright (c) Andrew Arnott. All rights reserved. -// </copyright> -//----------------------------------------------------------------------- - -namespace DotNetOpenAuth.Test.Messaging { - using System.Collections; - using System.Collections.Generic; - using Microsoft.VisualStudio.TestTools.UnitTesting; - - internal class CollectionAssert<T> { - internal static void AreEquivalent(ICollection<T> expected, ICollection<T> actual) { - ICollection expectedNonGeneric = new List<T>(expected); - ICollection actualNonGeneric = new List<T>(actual); - CollectionAssert.AreEquivalent(expectedNonGeneric, actualNonGeneric); - } - } -} +//-----------------------------------------------------------------------
+// <copyright file="CollectionAssert.cs" company="Andrew Arnott">
+// Copyright (c) Andrew Arnott. All rights reserved.
+// </copyright>
+//-----------------------------------------------------------------------
+
+namespace DotNetOpenAuth.Test.Messaging {
+ using System.Collections;
+ using System.Collections.Generic;
+ using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+ internal class CollectionAssert<T> {
+ internal static void AreEquivalent(ICollection<T> expected, ICollection<T> actual) {
+ ICollection expectedNonGeneric = new List<T>(expected);
+ ICollection actualNonGeneric = new List<T>(actual);
+ CollectionAssert.AreEquivalent(expectedNonGeneric, actualNonGeneric);
+ }
+
+ internal static void AreEquivalentByEquality(ICollection<T> expected, ICollection<T> actual) {
+ Assert.AreEqual(expected.Count, actual.Count);
+ foreach (T value in expected) {
+ Assert.IsTrue(actual.Contains(value));
+ }
+ }
+ }
+}
|