public void AddTest() { ISet set = new Iesi.Collections.ListSet(); ICollection<int> target = new ISetWrapper<int>(set); int item = 5; target.Add(item); Assert.AreEqual(1, set.Count); Assert.IsTrue(set.Contains(item)); }
public void ClearTest() { ISet set = new Iesi.Collections.ListSet(); ICollection<int> target = new ISetWrapper<int>(set); for (int i = 0; i < 5; i++) target.Add(i); target.Clear(); Assert.AreEqual(0, set.Count); Assert.AreEqual(0, target.Count); }
public void CopyToTest() { ISet set = new Iesi.Collections.ListSet(); ICollection<int> target = new ISetWrapper<int>(set); for (int i = 0; i < 5; i++) target.Add(i); int[] array = new int[target.Count]; target.CopyTo(array, 0); for (int i = 0; i < target.Count; i++) Assert.IsTrue(target.Contains(array[i])); }
public void RemoveTest() { ISet set = new Iesi.Collections.ListSet(); ICollection<int> target = new ISetWrapper<int>(set); int item = 5; target.Add(item); target.Remove(item); Assert.AreEqual(0, set.Count); Assert.IsFalse(set.Contains(item)); }
public void CountTest() { ISet set = new Iesi.Collections.ListSet(); ICollection<int> target = new ISetWrapper<int>(set); Assert.AreEqual(set.Count, target.Count); target.Add(5); Assert.AreEqual(set.Count, target.Count); }