예제 #1
0
        public void GivenEmptyQuery_ExpectNormalizedResult()
        {
            const string Query = "random string";

            string[] targets = new string[] { Query };
            var      matcher = new StringFuzzyMatcher <string>(targets);

            var match = matcher.FindNearest(string.Empty);

            // this is the regular matcher equivalent (an empty string threshold scale is 1)
            Assert.AreEqual(Query.Length, match.Distance);
            Assert.AreEqual(Query, match.Element);
        }