コード例 #1
0
        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"));
        }
コード例 #2
0
        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());
        }
コード例 #3
0
        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());
        }