コード例 #1
0
        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");
        }
コード例 #2
0
        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");
        }
コード例 #3
0
        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");
        }
コード例 #4
0
        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"));
        }
コード例 #5
0
		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);
		}
コード例 #6
0
ファイル: ListSetTests.cs プロジェクト: ouyangyl/MySpringNet
 public override void SetUp () 
 {
     Set = new ListSet ();
     SetForSetOps = new ListSet ();
 }
コード例 #7
0
 public override void SetUp()
 {
     Set          = new ListSet();
     SetForSetOps = new ListSet();
 }
コード例 #8
0
 public void SetUp ()
 {
     one = new ListSet (new object [] {1, "Foo", 2});
     two = new ListSet (new object [] {1, 3});
 }
コード例 #9
0
 public void SetUp()
 {
     one = new ListSet(new object [] { 1, "Foo", 2 });
     two = new ListSet(new object [] { 1, 3 });
 }
コード例 #10
0
 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");
 }
コード例 #11
0
 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");
 }
コード例 #12
0
 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");
 }
コード例 #13
0
 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"));
 }