public void BoostParameter002() { // Arrange var container = new List <string>(); var expressionCache = new ExpressionCache <TestDocument>(); var expressionBuilder = new ExpressionBuilder <TestDocument>(expressionCache); var parameter = new BoostParameter <TestDocument>(expressionBuilder); parameter.Configure(new Any <TestDocument>("id"), BoostFunctionType.Boost); // Act parameter.Execute(container); // Assert Assert.Equal(1, container.Count); Assert.Equal("boost=id", container[0]); }
public void BoostParameter002() { // Arrange var expected = JObject.Parse(@" { ""params"": { ""boost"": ""id"" } }"); string actual; var jObject = new JObject(); var expressionCache = new ExpressionCache <TestDocument>(); var expressionBuilder = new ExpressionBuilder <TestDocument>(expressionCache); var parameter = new BoostParameter <TestDocument>(expressionBuilder); parameter.Configure(new Any <TestDocument>("id"), BoostFunctionType.Boost); // Act parameter.Execute(jObject); actual = jObject.ToString(); // Assert Assert.Equal(actual, expected.ToString()); }