public void CountRepeatss_ReturnCaseInsensitiveInputSentence_Score() { RepeatCounter testRepeatCounter = new RepeatCounter("This is my Dog", "dog"); int expected = 1; int output = testRepeatCounter.CountRepeats(); Assert.Equal(expected, output); }
public void CountRepeats_ReturnNone_Score() { RepeatCounter testRepeatCounter = new RepeatCounter("This is my dog", "cat"); int expected = 0; int output = testRepeatCounter.CountRepeats(); Assert.Equal(expected, output); }
public void CountRepeats_ReturnScore_Score() { RepeatCounter testRepeatCounter = new RepeatCounter("This is my dog and his dog", "dog"); int expected = 2; int output = testRepeatCounter.CountRepeats(); Assert.Equal(expected, output); }
public void CountRepeats_ReturnCountForSpecialCharacters_Number() { //Arrange string userString = "I have a DOG named Bozo. My dog loves to go on hikes! I love my Dog! Dog, Dog, DOg!"; string findWord = "dog"; RepeatCounter testRepeatCounter = new RepeatCounter(userString, findWord); //Act int result = testRepeatCounter.CountRepeats(); //Assert Assert.Equal(6, result); }
public void CountRepeats_ReturnCountForToLowercase_Number() { //Arrange string userString = "I have a DOG named Bozo. My dog loves to go on hikes! My dog is awesome."; string findWord = "dog"; RepeatCounter testRepeatCounter = new RepeatCounter(userString, findWord); //Act int result = testRepeatCounter.CountRepeats(); //Assert Assert.Equal(3, result); }
public void CountRepeats_ReturnCountForMatchingWord_Number() { //Arrange string userString = "I have a dog named Bozo. My dog loves to go on hikes"; string findWord = "dog"; RepeatCounter testRepeatCounter = new RepeatCounter(userString, findWord); //Act int result = testRepeatCounter.CountRepeats(); //Assert Assert.Equal(2, result); }
public void CountRepeats_ReturnCountForMultipleWords_Number() { //Arrange string userString = "dog dog dog dog"; string findWord = "dog"; RepeatCounter testRepeatCounter = new RepeatCounter(userString, findWord); //Act int result = testRepeatCounter.CountRepeats(); //Assert Assert.Equal(4, result); }
public void CountRepeats_ReturnCountForWord_Number() { //Arrange string userString = "dog"; string userWord = "dog"; RepeatCounter testRepeatCounter = new RepeatCounter(userString, userWord); //Act int result = testRepeatCounter.CountRepeats(); //Assert Assert.Equal(1, result); }
public HomeModule() { Get["/"] = _ => { return(View["index.cshtml"]); }; Post["/results"] = _ => { string userString = Request.Form["user-string"]; string findWord = Request.Form["find-word"]; RepeatCounter newCounter = new RepeatCounter(userString, findWord); int result = newCounter.CountRepeats(); return(View["results.cshtml", result]); }; Post["/new"] = _ => { return(View["index.cshtml"]); }; }