Exemple #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);
        }
Exemple #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;
 }