public void ShouldReturnFalseWhenOneLetter() { var sol = new RepeatedSubstringPatternSolution(); Assert.IsFalse(sol.RepeatedSubstringPattern("a")); Assert.IsFalse(sol.RepeatedSubstringPattern("z")); }
public void ShouldReturnFalseWhenNullOrEmpty() { var sol = new RepeatedSubstringPatternSolution(); Assert.IsFalse(sol.RepeatedSubstringPattern(null)); Assert.IsFalse(sol.RepeatedSubstringPattern(String.Empty)); }
public void TwoLetters() { var sol = new RepeatedSubstringPatternSolution(); Assert.IsTrue(sol.RepeatedSubstringPattern("aa")); Assert.IsTrue(sol.RepeatedSubstringPattern("zz")); Assert.IsFalse(sol.RepeatedSubstringPattern("ab")); Assert.IsFalse(sol.RepeatedSubstringPattern("xy")); }
public void FiveLetters() { var sol = new RepeatedSubstringPatternSolution(); Assert.IsTrue(sol.RepeatedSubstringPattern("aaaaa")); Assert.IsFalse(sol.RepeatedSubstringPattern("bbaaa")); Assert.IsFalse(sol.RepeatedSubstringPattern("zazza")); Assert.IsFalse(sol.RepeatedSubstringPattern("aaaab")); Assert.IsFalse(sol.RepeatedSubstringPattern("abcde")); Assert.IsFalse(sol.RepeatedSubstringPattern("xxyzz")); Assert.IsFalse(sol.RepeatedSubstringPattern("xyyzz")); }
public void ThreeLetters() { var sol = new RepeatedSubstringPatternSolution(); Assert.IsTrue(sol.RepeatedSubstringPattern("aaa")); Assert.IsTrue(sol.RepeatedSubstringPattern("bbb")); Assert.IsFalse(sol.RepeatedSubstringPattern("zaz")); Assert.IsFalse(sol.RepeatedSubstringPattern("abc")); Assert.IsFalse(sol.RepeatedSubstringPattern("xxy")); Assert.IsFalse(sol.RepeatedSubstringPattern("xyy")); }