示例#1
0
 public void RetainAll()
 {
     Assert.Throws <NotSupportedException>(() => Set.RetainAll(new object[] { 1, 9 }));
 }
示例#2
0
 public void Clear()
 {
     Assert.Throws <NotSupportedException>(() => Set.Clear());
 }
示例#3
0
 public void Remove()
 {
     Assert.Throws <NotSupportedException>(() => Set.Remove(1));
 }
示例#4
0
 public void RemoveAll()
 {
     object[] removed = new object[] { 1, 3 };
     Assert.Throws <NotSupportedException>(() => Set.RemoveAll(removed));
 }
示例#5
0
 public void AddAll()
 {
     Assert.Throws <NotSupportedException>(() => Set.AddAll(new int[] { 4, 5, 6 }));
 }
示例#6
0
 public void Add()
 {
     Assert.Throws <NotSupportedException>(() => Set.Add(1));
 }
示例#7
0
        public void ClonedInstanceMustStillBeImmutable()
        {
            ISet clone = (ISet)Set.Clone();

            Assert.Throws <NotSupportedException>(() => clone.Add("bad chair, bad chair"));
        }
示例#8
0
 public void ContainsAll()
 {
     Assert.IsFalse(Set.ContainsAll(new object[] { "Funk", 1, 2, 3 }));
     Assert.IsTrue(Set.ContainsAll(new object[] { 1, 3, 2 }));
 }
示例#9
0
 public void Contains()
 {
     Assert.IsFalse(Set.Contains("Funk"));
     Assert.IsTrue(Set.Contains(1));
 }