public void CountRepeats_MultiWordsMultiCount_two() { //Arrange string sentInput = "monkeys like to eat bananas for breakfast and bananas for dinner"; string wordInput = "bananas"; RepeatCounter newCounter = new RepeatCounter(sentInput, wordInput); //Act int result = newCounter.CountRepeats(sentInput, wordInput); //Assert Assert.Equal(2, result); }
public void CountRepeats_MultiWordsCloseMatchError_zero() { //Arrange string sentInput = "monkeys like to eat bananas"; string wordInput = "banana"; RepeatCounter newCounter = new RepeatCounter(sentInput, wordInput); //Act int result = newCounter.CountRepeats(sentInput, wordInput); //Assert Assert.Equal(0, result); }
public void CountRepeats_Punctuation_one() { //Arrange string sentInput = "monkeys like to eat bananas."; string wordInput = "Bananas"; RepeatCounter newCounter = new RepeatCounter(sentInput, wordInput); //Act int result = newCounter.CountRepeats(sentInput, wordInput); //Assert Assert.Equal(1, result); }
public void CountRepeats_SingleWord_one() { //Arrange string sentInput = "bananas"; string wordInput = "bananas"; RepeatCounter newCounter = new RepeatCounter(sentInput, wordInput); //Act int result = newCounter.CountRepeats(sentInput, wordInput); //Assert Assert.Equal(1, result); }
public void CountRepeats_MultiWordsCaseInsensitive_one() { //Arrange string sentInput = "monkeys like to eat bananas"; string wordInput = "Bananas"; RepeatCounter newCounter = new RepeatCounter(sentInput, wordInput); //Act int result = newCounter.CountRepeats(sentInput, wordInput); //Assert Assert.Equal(1, result); }
public void Test_StringEqual_1() { //Arrange string inputWord = "A"; string inputText = "A"; //ACT RepeatCounter testInput = new RepeatCounter(inputWord, inputText); int testResult = testInput.CountRepeats(); //Assert Assert.Equal(testResult, 1); }
public void Test_CountLikeWordsInText_8() { //Arrange string inputWord = "buffalo"; string inputText = "The buffalo is large. Buffalo is my name. The buffalo is large. Buffalo is my name. The buffalo is large. Buffalo is my name. The buffalo is large. Buffalo is my name. Buffalo's Rock!"; //Act RepeatCounter testInput = new RepeatCounter(inputWord, inputText); int testResult = testInput.CountRepeats(); //Assert Assert.Equal(8, testResult); }
public void Test_StringCompareEqualCaseless_1() { //Arrange string inputWord = "buffalo"; string inputText = "BuFFalO"; //Act RepeatCounter testInput = new RepeatCounter(inputWord, inputText); int testResult = testInput.CountRepeats(); //Assert Assert.Equal(testResult, 1); }
public HomeModule() { Get["/"] = _ => { return(View["forms.cshtml"]); }; Post["/"] = _ => { RepeatCounter newRepeatCounter = new RepeatCounter(Request.Form["long-string"]); newRepeatCounter.SetTargetWord(Request.Form["target-word"]); newRepeatCounter.StringSplitter(); newRepeatCounter.FindWord(); return(View["index.cshtml", newRepeatCounter]); }; }
public void RepeatCounterCheck_ForUserInput_0() { RepeatCounter repeatCounterTest = new RepeatCounter(); Assert.Equal(0, repeatCounterTest.CounterRepeats("", "")); }
public void RepeatCounterCheck_ForUserInputHELLO_HerloHEllohelloHELLO_2() { RepeatCounter repeatCounterTest = new RepeatCounter(); Assert.Equal(3, repeatCounterTest.CounterRepeats("HELLO", "Herlo HEllo hello HELLO")); }
public void RepeatCounterCheck_ForUserInputHello_HelloGoodbyeHello_2() { RepeatCounter repeatCounterTest = new RepeatCounter(); Assert.Equal(2, repeatCounterTest.CounterRepeats("Hello", "Hello Goodbye Hello")); }