Ejemplo n.º 1
0
        public void BasicTests(int excepted, string inputStirng)
        {
            var kata   = new CountingDuplicates();
            var actual = kata.DuplicateCount(inputStirng);

            Assert.AreEqual(excepted, actual);
        }
Ejemplo n.º 2
0
        public void Duplicates_Count_Is_Not_Zero()
        {
            var input    = "abca";
            var result   = CountingDuplicates.DuplicateCount(input);
            var expected = 1;

            Assert.AreEqual(expected, result);
        }
Ejemplo n.º 3
0
        public void Input_String_Counting_Duplicates_As_expected(string inputString, int expected)
        {
            var target = new CountingDuplicates();

            var actual = target.CountDuplicateChar(inputString);

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 4
0
 public void DuplicateCountTests()
 {
     Assert.AreEqual(0, CountingDuplicates.DuplicateCount(""));
     Assert.AreEqual(0, CountingDuplicates.DuplicateCount("abcde"));
     Assert.AreEqual(2, CountingDuplicates.DuplicateCount("aabbcde"));
     Assert.AreEqual(2, CountingDuplicates.DuplicateCount("aabBcde"), "should ignore case");
     Assert.AreEqual(1, CountingDuplicates.DuplicateCount("Indivisibility"));
     Assert.AreEqual(2, CountingDuplicates.DuplicateCount("Indivisibilities"), "characters may not be adjacent");
 }
Ejemplo n.º 5
0
 public void DuplicateCountTest()
 {
     Assert.AreEqual(0, CountingDuplicates.DuplicateCount(""));
     Assert.AreEqual(0, CountingDuplicates.DuplicateCount("abcde"));
     Assert.AreEqual(2, CodeWars.CountingDuplicates.DuplicateCount("aabbcde"));
     Assert.AreEqual(2, CodeWars.CountingDuplicates.DuplicateCount("aabBcde"));
     Assert.AreEqual(1, CodeWars.CountingDuplicates.DuplicateCount("Indivisibility"));
     Assert.AreEqual(2, CodeWars.CountingDuplicates.DuplicateCount("Indivisibilities"));
     Assert.AreEqual(2, CodeWars.CountingDuplicates.DuplicateCount("aabbcde"));
 }
Ejemplo n.º 6
0
        private static void AssertDuplicateCountByInputString(int expected, string input)
        {
            //given param input

            //when
            int result = CountingDuplicates.DuplicateCount(input);

            //then
            Assert.AreEqual(expected, result);
        }
Ejemplo n.º 7
0
 public void ShouldReturnTheNumberOfDuplicateCharactersInAGivenString(string input, int expected)
 {
     Assert.Equal(expected, CountingDuplicates.DuplicateCount(input));
 }
        public int SampleTests(string input)
        {
            var kata = new CountingDuplicates();

            return(kata.DuplicateCount(input));
        }
Ejemplo n.º 9
0
        public void TestCountingDuplicates(int excepted, string inputString)
        {
            var actual = CountingDuplicates.DuplicateCount(inputString);

            Assert.AreEqual(excepted, actual);
        }