예제 #1
0
        public void Should_return_two_when_calculating_distance_with_different_words()
        {
            LevenshteinDistanceCalculator distanceCalculator = new LevenshteinDistanceCalculator();
            int disctance = distanceCalculator.Calculate("a", "bc");

            Check.That(disctance).IsEqualTo(2);
        }
예제 #2
0
        public void Should_return_one_when_calculating_distance_with_words_with_one_different_letter()
        {
            LevenshteinDistanceCalculator distanceCalculator = new LevenshteinDistanceCalculator();
            int disctance = distanceCalculator.Calculate("a", "b");

            Check.That(disctance).IsEqualTo(1);
        }
예제 #3
0
        public void Should_return_one_when_calculating_distance_with_one_word_and_one_same_with_an_additional_letter()
        {
            LevenshteinDistanceCalculator distanceCalculator = new LevenshteinDistanceCalculator();
            int disctance = distanceCalculator.Calculate("a", "ab");

            Check.That(disctance).IsEqualTo(1);
        }
예제 #4
0
        public void Should_return_zero_when_calculating_distance_with_same_word()
        {
            LevenshteinDistanceCalculator distanceCalculator = new LevenshteinDistanceCalculator();
            int disctance = distanceCalculator.Calculate("a", "a");

            Check.That(disctance).IsEqualTo(0);
        }