public void WildCardLiteralTest_TrailingWildcard() { WildcardLiteral wildcard = new WildcardLiteral("hell*", kGram); IList <Posting> result = wildcard.GetPostings(index, processor); IList <Posting> expected = UnitTest.GeneratePostings("(0,[0,1]), (2,[0,2,3])"); result.Should().BeEquivalentTo(expected); }
public void WildCardLiteralTest_NotExist_ReturnsEmpty() { //1. Not existing wildcard query WildcardLiteral wildcard1 = new WildcardLiteral("zeb*", kGram); IList <Posting> result = wildcard1.GetPostings(index, processor); result.Should().BeEmpty("because no posting exist for the wildcard 'zeb*'"); //2. Exception of putting empty string to wildcard query WildcardLiteral wildcard2 = new WildcardLiteral("", kGram); result = wildcard2.GetPostings(index, processor); result.Should().BeEmpty("because wildcard query got empty string"); }