Exemplo n.º 1
0
 public void LongestCommonSubstring1()
 {
     Assert.Equal(EditDistance.GetLongestCommonSubsequenceLength("a", "a"), 1);
     Assert.Equal(EditDistance.GetLongestCommonSubsequenceLength("ab", "a"), 1);
     Assert.Equal(EditDistance.GetLongestCommonSubsequenceLength("a", "ab"), 1);
     Assert.Equal(EditDistance.GetLongestCommonSubsequenceLength("ba", "ab"), 1);
     Assert.Equal(EditDistance.GetLongestCommonSubsequenceLength("foo", "arf"), 1);
 }
Exemplo n.º 2
0
 public void MoreLongestCommonSubstring()
 {
     Assert.Equal(EditDistance.GetLongestCommonSubsequenceLength("aabaaab", "aaa"), 3);
     Assert.Equal(EditDistance.GetLongestCommonSubsequenceLength("kangaroo", "schoolbus"), 2);
     Assert.Equal(EditDistance.GetLongestCommonSubsequenceLength("inexorable", "exorcism"), 4);
 }
Exemplo n.º 3
0
 public void LongestCommonSubstring0()
 {
     Assert.Equal(EditDistance.GetLongestCommonSubsequenceLength("", ""), 0);
     Assert.Equal(EditDistance.GetLongestCommonSubsequenceLength("a", "b"), 0);
 }