示例#1
0
        public void RemoveDups_TwoEntries_OneRemoved()
        {
            var actual   = CreateTwoEntries();
            var expected = CreateTwoEntries();

            LinkedListExtensions.DeleteDups(ref actual);
            Assert.AreEqual(expected.Value, actual.Value);
            Assert.AreEqual(null, actual.Next);
        }
示例#2
0
        public void RemoveDups_OneEntry_Same()
        {
            var actual   = CreateOneEntry();
            var expected = CreateOneEntry();

            LinkedListExtensions.DeleteDups(ref actual);
            Assert.AreEqual(expected.Value, actual.Value);
            Assert.AreEqual(expected.Next, actual.Next);
        }
示例#3
0
        public void RemoveDups_SevenEntries_TwoRemoved()
        {
            var actual   = CreateSevenEntries();
            var expected = CreateSevenEntriesAnswer();

            LinkedListExtensions.DeleteDups(ref actual);

            while (expected != null)
            {
                Assert.AreEqual(expected.Value, actual.Value);
                expected = expected.Next;
                actual   = actual.Next;
            }

            Assert.AreEqual(expected, actual);
        }