public void FAIL_Create() { try { IndicesBoost boost = new IndicesBoost(new List<IndexBoost>()); Assert.Fail(); } catch(ArgumentNullException ex) { Assert.AreEqual("boostedIndices", ex.ParamName); } }
public void PASS_Serialize() { IndicesBoost boost = new IndicesBoost(new List<IndexBoost>() { new IndexBoost("index", 1.1) }); string json = JsonConvert.SerializeObject(boost); Assert.IsNotNull(json); string expectedJson = "{\"indices_boost\":{\"index\":1.1}}"; Assert.AreEqual(expectedJson, json); }
public void PASS_Create() { IndicesBoost boost = new IndicesBoost(new List<IndexBoost>() { new IndexBoost("index", 1.1) }); Assert.IsNotNull(boost); Assert.AreEqual(1, boost.BoostedIndices.Count()); Assert.AreEqual("index", boost.BoostedIndices.First().Index); Assert.AreEqual(1.1, boost.BoostedIndices.First().Boost); }