public void AddTest_ValueType() { IBag <int> bag = new ResizingArrayBag <int>(); bag.Add(1); Assert.IsFalse(bag.IsEmpty()); Assert.AreEqual(1, bag.Size()); }
public void AddTest_ReferenceType() { IBag <String> bag = new ResizingArrayBag <String>(); bag.Add("1"); Assert.IsFalse(bag.IsEmpty()); Assert.AreEqual(1, bag.Size()); }
public void ConstructorTest() { IBag <int> bag = new ResizingArrayBag <int>(); Assert.IsTrue(bag.IsEmpty()); Assert.AreEqual(0, bag.Size()); Assert.IsTrue(string.IsNullOrWhiteSpace(bag.ToString())); }
public void ManyAddTest() { IBag <int> bag = new ResizingArrayBag <int>(); for (int i = 0; i < 10; i++) { bag.Add(i); Assert.IsFalse(bag.IsEmpty()); Assert.AreEqual(i + 1, bag.Size()); } }