public void TestSubstringWithConcatenationAllWords() { string input = "barfoothefoobarman"; IList <string> words = new List <string>(); words.Add("foo"); words.Add("bar"); //var result = SubstringWithConcatenationAllWords.FindSubstring(input, words.ToArray()); StringPermutations testobj = new StringPermutations(); var result = testobj.FindSubstring(input, words.ToArray()); Assert.IsTrue(result.Count == 2); }
public void TestSubstringWithConcatenationAllWords2() { string input = "lingmindraboofooowingdingbarrwingmonkeypoundcake"; IList <string> words = new List <string>(); words.Add("fooo"); words.Add("barr"); words.Add("wing"); words.Add("ding"); words.Add("wing"); //var result = SubstringWithConcatenationAllWords.FindSubstring(input, words.ToArray()); StringPermutations testobj = new StringPermutations(); var result = testobj.FindSubstring(input, words.ToArray()); Assert.IsTrue(result.Count == 1, "result {0}", result.Count); }