예제 #1
0
        public void WhenExactRightToleranceMatchesOnlyForSomeFields_ShouldOnlyReturnCompositeMatchesForCorrectTokens()
        {
            var result = CompositePositionalIntersectMerger.Apply(exactMatchLeft, exactMatchRight, 0, 5);

            result.Should().BeEquivalentTo(
                ScoredToken(
                    7,
                    ScoredFieldMatch(2D, 1, (30, 35)),
                    ScoredFieldMatch(4D, 2, (5, 10))));
        }
예제 #2
0
        public void WhenExactToleranceMatches_ShouldReturnCompositeMatch()
        {
            var left   = IntermediateQueryResult(ScoredToken(7, ScoredFieldMatch(1D, 1, 30)));
            var right  = IntermediateQueryResult(ScoredToken(7, ScoredFieldMatch(1D, 1, 35)));
            var result = CompositePositionalIntersectMerger.Apply(left, right, 0, 5);

            result.Should().BeEquivalentTo(
                ScoredToken(7, ScoredFieldMatch(2D, 1, (30, 35)))
                );
        }