public void ExclusiveOrYieldsImmutableCone() { ISet mySet = new ListSet(new int [] { 1, 4 }); ISet clone = Set.ExclusiveOr(mySet); Assert.IsNotNull(clone); Assert.AreEqual(3, clone.Count); clone.Add("bad chair, bad chair"); }
public void MinusYieldsImmutableCone() { ISet mySet = new ListSet(new int [] { 1, 2 }); ISet clone = Set.Minus(mySet); Assert.IsNotNull(clone); Assert.AreEqual(1, clone.Count); clone.Add("bad chair, bad chair"); }
public void IntersectionYieldsImmutableCone() { ISet mySet = new ListSet(new int [] { 1, 4 }); ISet clone = Set.Intersect(mySet); Assert.IsNotNull(clone); Assert.AreEqual(1, clone.Count); clone.Add("bad chair, bad chair"); }
public void ExclusiveOrYieldsImmutableCone() { ISet mySet = new ListSet(new int[] { 1, 4 }); ISet clone = Set.ExclusiveOr(mySet); Assert.IsNotNull(clone); Assert.AreEqual(3, clone.Count); Assert.Throws <NotSupportedException>(() => clone.Add("bad chair, bad chair")); }
public void GetGenericArgumentValueIgnoresAlreadyUsedValues() { ISet used = new ListSet(); ConstructorArgumentValues values = new ConstructorArgumentValues(); values.AddGenericArgumentValue(1); values.AddGenericArgumentValue(2); values.AddGenericArgumentValue(3); Type intType = typeof (int); ConstructorArgumentValues.ValueHolder one = values.GetGenericArgumentValue(intType, used); Assert.AreEqual(1, one.Value); used.Add(one); ConstructorArgumentValues.ValueHolder two = values.GetGenericArgumentValue(intType, used); Assert.AreEqual(2, two.Value); used.Add(two); ConstructorArgumentValues.ValueHolder three = values.GetGenericArgumentValue(intType, used); Assert.AreEqual(3, three.Value); used.Add(three); ConstructorArgumentValues.ValueHolder four = values.GetGenericArgumentValue(intType, used); Assert.IsNull(four); }
public override void SetUp () { Set = new ListSet (); SetForSetOps = new ListSet (); }
public override void SetUp() { Set = new ListSet(); SetForSetOps = new ListSet(); }
public void SetUp () { one = new ListSet (new object [] {1, "Foo", 2}); two = new ListSet (new object [] {1, 3}); }
public void SetUp() { one = new ListSet(new object [] { 1, "Foo", 2 }); two = new ListSet(new object [] { 1, 3 }); }
public void ExclusiveOrYieldsImmutableCone () { ISet mySet = new ListSet (new int [] {1, 4}); ISet clone = Set.ExclusiveOr (mySet); Assert.IsNotNull (clone); Assert.AreEqual (3, clone.Count); clone.Add ("bad chair, bad chair"); }
public void IntersectionYieldsImmutableCone () { ISet mySet = new ListSet (new int [] {1, 4}); ISet clone = Set.Intersect (mySet); Assert.IsNotNull (clone); Assert.AreEqual (1, clone.Count); clone.Add ("bad chair, bad chair"); }
public void MinusYieldsImmutableCone () { ISet mySet = new ListSet (new int [] {1, 2}); ISet clone = Set.Minus (mySet); Assert.IsNotNull (clone); Assert.AreEqual (1, clone.Count); clone.Add ("bad chair, bad chair"); }
public void ExclusiveOrYieldsImmutableCone() { ISet mySet = new ListSet(new int[] {1, 4}); ISet clone = Set.ExclusiveOr(mySet); Assert.IsNotNull(clone); Assert.AreEqual(3, clone.Count); Assert.Throws<NotSupportedException>(() => clone.Add("bad chair, bad chair")); }