Permalink
Browse files

Added tests for GetUnionOfSets, GetIntersectionOfSets, and GetDiffere…

…nceOfSets
  • Loading branch information...
1 parent 76a9a38 commit dcc26c1f976c5edbeb09228a7bedb1279ae43d5c Jonathan Steele committed Mar 31, 2010
Showing with 11 additions and 0 deletions.
  1. +11 −0 test.cs
View
11 test.cs
@@ -103,6 +103,17 @@ static void Main (string[] args)
assert(r.RemoveFromSet("FOO", "Hoge"), "Should have removed Hoge from set");
assert(!r.RemoveFromSet("FOO", "Hoge"), "Hoge should not have existed to be removed");
assert(2 == r.GetMembersOfSet("FOO").Length, "Set should have 2 members after removing Hoge");
+
+ assert(r.AddToSet("BAR", Encoding.UTF8.GetBytes("BAR")), "Problem adding to set");
+ assert(r.AddToSet("BAR", Encoding.UTF8.GetBytes("ITEM1")),"Problem adding to set");
+ assert(r.AddToSet("BAR", Encoding.UTF8.GetBytes("ITEM2")),"Problem adding string to set");
+
+ assert(r.GetUnionOfSets("FOO","BAR").Length == 4, "Resulting union should have 4 items");
+ assert(r.GetIntersectionOfSets("FOO", "BAR").Length == 1, "Resulting intersection should have 1 item");
+ assert(r.GetDifferenceOfSets("FOO", "BAR").Length == 1, "Resulting difference should have 1 item");
+ assert(r.GetDifferenceOfSets("BAR", "FOO").Length == 2, "Resulting difference should have 2 items");
+
+
}
static void assert(bool condition, string message)

0 comments on commit dcc26c1

Please sign in to comment.