예제 #1
0
        public void GetFuzzyComparer_ValidComparerType_ShouldReturnTheCorrectStrategy(FuzzyStringComparerType comparerType, string expectedComparerTypeName)
        {
            // Act
            IFuzzyComparerStrategy returnedComparer = this.fuzzyComparerFactory.GetFuzzyComparer(comparerType);

            // Assert
            Assert.AreEqual(expectedComparerTypeName, returnedComparer.GetType().Name);
        }
예제 #2
0
        public double CompareStrings(FuzzyStringComparerType fuzzyComparerType, string stringOne, string stringTwo)
        {
            IFuzzyComparerStrategy comparerStrategy = fuzzyComparerFactory.GetFuzzyComparer(fuzzyComparerType);

            return(comparerStrategy.Compare(stringOne, stringTwo));
        }
 public LevenshteinDistancePercentageFuzzyComparer(IFuzzyComparerStrategy levenshteinDistanceComparer)
 {
     this.levenshteinDistanceComparer = levenshteinDistanceComparer;
 }