public void MinusYieldsImmutableCone() { ISet mySet = new ListSet(new int[] { 1, 2 }); ISet clone = Set.Minus(mySet); Assert.IsNotNull(clone); Assert.AreEqual(1, clone.Count); Assert.Throws <NotSupportedException>(() => clone.Add("bad chair, bad chair")); }
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 Minus() { ISet actual = Set.Minus(one, two); Assert.IsNotNull(actual); Assert.AreEqual(2, actual.Count); Assert.IsTrue(actual.ContainsAll(new object [] { "Foo", 2 })); CheckThatOriginalsHaveNotBeenModified(); Assert.IsNull(Set.Minus(null, two)); }