예제 #1
0
 public void RepeatCounter_CountNumberOfMatches_Integer()
 {
     //Arrange
     string input = "hello";
     string inputList="hello is hello my hello";
     WordChecker newCount = new WordChecker(input,inputList);
     
     //Act
      int result = newCount.RepeatCounter();
     
     //Assert
     Assert.AreEqual(3, result);
 
 }
예제 #2
0
 public void RepeatCounter_CheckIfInputAndListNotEqual_String()
 {
     //Arrange
     string input = "hello";
     string inputList="hey";
     WordChecker newCount = new WordChecker(input,inputList);
     
     //Act
      int result = newCount.RepeatCounter();
     
     //Assert
     Assert.AreEqual(0, result);
 
 }
예제 #3
0
 public void RepeatCounter_CheckIfInputAndListEmpty_Integer()
 {
     //Arrange
     string input = "";
     string inputList = "";
     WordChecker newCount = new WordChecker(input,inputList);
     
     //Act
      int result = newCount.RepeatCounter();
     
     //Assert
     Assert.AreEqual(-1, result);
 
 }
예제 #4
0
 public void RepeatCounter_CountMatchesOnlyExactinput1_Integer()
 {
     //Arrange
     string input = "shamonahello";
     string inputList = "hey hello";
     WordChecker newCount = new WordChecker(input,inputList);
     
     //Act
      int result = newCount.RepeatCounter();
     
     //Assert
     Assert.AreEqual(0, result);
 
 }
예제 #5
0
        public void RepeatCounter_CountNumberOfMatches_Integer()
        {
            //Arrange
            string        input     = "hello";
            List <string> inputList = new List <string> {
                "hey", "hello", "ciao", "hello", "Hello"
            };
            WordChecker newCount = new WordChecker(input, inputList);

            //Act
            int result = newCount.RepeatCounter();

            //Assert
            Assert.AreEqual(3, result);
        }
예제 #6
0
        public void RepeatCounter_CountMatchesOnlyExactinput_Integer()
        {
            //Arrange
            string        input     = "hello";
            List <string> inputList = new List <string> {
                "hey", "shammonahello", "ciao"
            };
            WordChecker newCount = new WordChecker(input, inputList);

            //Act
            int result = newCount.RepeatCounter();

            //Assert
            Assert.AreEqual(0, result);
        }