public void TestRemoveValidElementRemovesSelectedOne() { var elements = new[] { "Ivan", "Nasko" }; var sut = new SimpleSortedListFake <string>(); sut.AddAll(elements); sut.Remove("Ivan"); Assert.That(() => !sut.ExposeCollection().Contains("Ivan")); }
public void TestAddAllKeepsSorted() { var expectedCollection = new[] { "Balkan", "Georgi", "Rosen" , null, null, null, null, null, null, null, null, null, null, null, null, null, }; var sut = new SimpleSortedListFake <string>(); var elements = new[] { "Rosen", "Georgi", "Balkan" }; sut.AddAll(elements); CollectionAssert.AreEqual(expectedCollection, sut.ExposeCollection()); }
public void TestAddUnsortedDataIsHeldSorted() { var expectedCollection = new[] { "Balkan", "Georgi", "Rosen" , null, null, null, null, null, null, null, null, null, null, null, null, null, }; var sut = new SimpleSortedListFake <string>(); var elements = new[] { "Rosen", "Georgi", "Balkan" }; foreach (var element in elements) { sut.Add(element); } CollectionAssert.AreEqual(expectedCollection, sut.ExposeCollection()); }