public void WordBreakIITestErrorCase() { WordBreakII wb = new WordBreakII(); SortedSet<string> wordset = new SortedSet<string>(); wordset.Add("aaaa"); wordset.Add("aaa"); List<string> strs = (List<string>)wb.WordBreak("aaaaaaa", wordset); List<string> target = new List<string>() { "aaaa aaa", "aaa aaaa" }; Assert.IsTrue(isListEqual(target, strs)); }
public void WordBreakIITestExample() { WordBreakII wb = new WordBreakII(); SortedSet<string> wordset = new SortedSet<string>(); wordset.Add("cat"); wordset.Add("cats"); wordset.Add("and"); wordset.Add("sand"); wordset.Add("dog"); List<string> strs = (List<string>)wb.WordBreak("catsanddog", wordset); List<string> target = new List<string>(){"cats and dog", "cat sand dog"}; Assert.IsTrue(isListEqual(target, strs)); }