Example #1
0
        public void RemoveDup_ReturnsListWithDuplicatesRemoved()
        {
            Problem_01.RemoveDups(LIST_WITH_DUPLICATES);

            // Checking lists are equal.
            using (var e1 = LIST_WITH_DUPLICATES.GetEnumerator())
                using (var e2 = LIST_WITHOUT_DUPLICATES.GetEnumerator())
                {
                    while (e1.MoveNext() && e2.MoveNext())
                    {
                        if (!e1.Current.Equals(e2.Current))
                        {
                            Assert.Fail();
                        }
                    }
                }
        }
Example #2
0
        public void IsUnique_ReturnsFalseForNonUniqueCharsString()
        {
            var result = Problem_01.IsUnique(NON_UNIQUE_CHARS_STRING);

            Assert.IsFalse(result);
        }
Example #3
0
        public void IsUnique_ReturnsTrueForUniqueCharsString()
        {
            var result = Problem_01.IsUnique(UNIQUE_CHARS_STRING);

            Assert.IsTrue(result);
        }