Exemplo n.º 1
0
        public void CountDuplicates()
        {
            //Arrange
            CountDuplicates countDuplicates = new CountDuplicates();

            //Assert
            Assert.AreEqual(2, countDuplicates.Count("aabbcde"));
            Assert.AreEqual(2, countDuplicates.Count("aabbcdeB"));
            Assert.AreEqual(0, countDuplicates.Count("abcde"));
            Assert.AreEqual(1, countDuplicates.Count("indivisibility"));
        }
 public void answer_0_when_stringisnull()
 {
     Assert.AreEqual(0, CountDuplicates.DuplicateCount(""));
 }
 public void answer_2_when_two_duplicate_and_one_upper_case_vacabulary()
 {
     Assert.AreEqual(2, CountDuplicates.DuplicateCount("Indivisibilities"), "characters may not be adjacent");
 }
 public void answer_1_when_one_duplicate_and_one_upper_case_vacabulary()
 {
     Assert.AreEqual(1, CountDuplicates.DuplicateCount("Indivisibility"));
 }
 public void answer_2_when_two_duplicate_and_one_upper_case()
 {
     Assert.AreEqual(2, CountDuplicates.DuplicateCount("aabBcde"), "should ignore case");
 }
 public void answer_0_when_no_duplicate()
 {
     Assert.AreEqual(0, CountDuplicates.DuplicateCount("abcd"));
 }
 public void answer_2_when_two_duplicate()
 {
     Assert.AreEqual(2, CountDuplicates.DuplicateCount("aabbcde"));
 }