public void CanFindRepeatedWord() { string testString = "Once upon a time in a galaxy far, far away..."; string result = RepeatedWord.RepeatedWords(testString); Assert.Equal("a", result); }
public void Find_A_Repeating_Word_Despite_Case() { string testString = "Here is a string. It has the word here twice."; string actual = RepeatedWord.RepeatWord(testString); string expected = "here"; Assert.Equal(expected, actual); }
public void CanReturnRepeatedWordsTest() { string inputStr = "Once upon a time there was a brave princess who"; string outputStr = RepeatedWord.FirstRepeating(inputStr); Assert.Equal("a", outputStr); }
public void Successfully_Return_The_First_Repeated_Word() { string input = "Once upon a time, there was a brave princess who"; string actual = RepeatedWord.RepeatWord(input); string expected = "a"; Assert.Equal(expected, actual); }
public void Successfully_Strip_A_String_Of_Punctuation() { string testString = "Here is a string, it has some words, and some puncuation."; string actual = RepeatedWord.StripPunctuation(testString); string expected = "Here is a string it has some words and some puncuation"; Assert.Equal(expected, actual); }
public void Successfully_Split_A_String_Into_An_Array() { string testString = "Here is a string, it has some words, and some puncuation."; string[] actual = RepeatedWord.SplitString(testString); string[] expected = new string[] { "Here", "is", "a", "string", "it", "has", "some", "words", "and", "some", "puncuation" }; Assert.Equal(expected, actual); }
public void FirstRepeatReturnsFirstRepeatedWord(string expect, string val) { var words = new RepeatedWord(val); Assert.Equal(expect, words.FirstRepeat()); }
public void Return_Null_If_Input_String_Is_Empty() { string input = ""; Assert.Null(RepeatedWord.RepeatWord(input)); }
public void Reutrn_Null_If_There_Are_No_Repeats() { string input = "There are no repeats in this sentence."; Assert.Null(RepeatedWord.RepeatWord(input)); }