public void Intersect() { Set.AddAll(UniqueStuff); SetForSetOps.AddAll(new object [] { "Bar", StuffOne }); ISet intersection = Set.Intersect(SetForSetOps); Assert.IsTrue(intersection.Count == 1); Assert.IsFalse(object.ReferenceEquals(intersection, Set), "Got back same instance after set operation."); Assert.IsTrue(Set.Count == UniqueStuff.Length); Assert.IsTrue(SetForSetOps.Count == 2); }
public void Minus() { Set.AddAll(UniqueStuff); SetForSetOps.AddAll(new object [] { "Bar", StuffOne }); ISet minus = Set.Minus(SetForSetOps); Assert.IsTrue(minus.Count == UniqueStuff.Length - 1); Assert.IsFalse(object.ReferenceEquals(minus, Set), "Got back same instance after set operation."); Assert.IsTrue(Set.Count == UniqueStuff.Length); Assert.IsTrue(SetForSetOps.Count == 2); }
public void ExclusiveOr() { Set.AddAll(UniqueStuff); SetForSetOps.AddAll(new object [] { "Bar", StuffOne }); ISet xor = Set.ExclusiveOr(SetForSetOps); Assert.IsTrue(xor.Count == 3); Assert.IsTrue(xor.ContainsAll(new object [] { "Bar", StuffTwo, StuffThree })); Assert.IsFalse(object.ReferenceEquals(xor, Set), "Got back same instance after set operation."); Assert.IsTrue(Set.Count == UniqueStuff.Length); Assert.IsTrue(SetForSetOps.Count == 2); }