public void Export_Omits_Field_If_Not_Provided() { var query = new NumericRangeQuery() .Min(1) .Max(10); var expected = JsonConvert.SerializeObject(new { min = 1.0, inclusive_min = true, max = 10.0, inclusive_max = false }, Formatting.None); Assert.AreEqual(expected, query.Export().ToString(Formatting.None)); }
public void Export_Returns_Valud_Json() { var query = new NumericRangeQuery() .Min(1) .Max(10) .Field("field"); var expected = JsonConvert.SerializeObject(new { min = 1.0, inclusive_min = true, max = 10.0, inclusive_max = false, field = "field" }, Formatting.None); Assert.AreEqual(expected, query.Export().ToString(Formatting.None)); }
public void Boost_WhenBoostIsLessThanZero_ThrowsArgumentOutOfRangeException() { var query = new NumericRangeQuery(); Assert.Throws<ArgumentOutOfRangeException>(() => query.Boost(-.1)); }
public void Boost_Returns_NumericRangeQuery() { var query = new NumericRangeQuery().Boost(2.2); Assert.IsInstanceOf<NumericRangeQuery> (query); }