Exemple #1
0
 public void CompositeStringYieldsOneResult()
 {
     this.sut.ParseQueryTokens("\"Jack be quick\"").Should().BeEquivalentTo(
         QueryToken.ForOperator(QueryTokenType.BeginAdjacentTextOperator),
         QueryToken.ForWord("Jack"),
         QueryToken.ForWord("be"),
         QueryToken.ForWord("quick"),
         QueryToken.ForOperator(QueryTokenType.EndAdjacentTextOperator));
 }
Exemple #2
0
 public void TwoCompositeStringsYieldsSixResults()
 {
     this.sut.ParseQueryTokens(@"""First string"" ""Second string""").Should().BeEquivalentTo(
         QueryToken.ForOperator(QueryTokenType.BeginAdjacentTextOperator),
         QueryToken.ForWord("First"),
         QueryToken.ForWord("string"),
         QueryToken.ForOperator(QueryTokenType.EndAdjacentTextOperator),
         QueryToken.ForOperator(QueryTokenType.BeginAdjacentTextOperator),
         QueryToken.ForWord("Second"),
         QueryToken.ForWord("string"),
         QueryToken.ForOperator(QueryTokenType.EndAdjacentTextOperator));
 }
Exemple #3
0
 public void OperatorTokensAreParsedCorrectly()
 {
     this.sut.ParseQueryTokens(@"& ( | ) ~> ~2> > ~ ~2 test=").Should().BeEquivalentTo(
         QueryToken.ForOperator(QueryTokenType.AndOperator),
         QueryToken.ForOperator(QueryTokenType.OpenBracket),
         QueryToken.ForOperator(QueryTokenType.OrOperator),
         QueryToken.ForOperator(QueryTokenType.CloseBracket),
         QueryToken.ForOperatorWithTolerance(QueryTokenType.PrecedingNearOperator, 5),
         QueryToken.ForOperatorWithTolerance(QueryTokenType.PrecedingNearOperator, 2),
         QueryToken.ForOperator(QueryTokenType.PrecedingOperator),
         QueryToken.ForOperatorWithTolerance(QueryTokenType.NearOperator, 5),
         QueryToken.ForOperatorWithTolerance(QueryTokenType.NearOperator, 2),
         QueryToken.ForFieldFilter("test"));
 }