public void PASS_Create() { FilterFacet facet = new FilterFacet("name", new TermFilter("field", "value")); Assert.IsNotNull(facet); Assert.AreEqual("name", facet.FacetName); Assert.AreEqual("field", (facet.Filter as TermFilter).Field); Assert.AreEqual("value", (facet.Filter as TermFilter).Value); }
public void PASS_Serialize() { FilterFacet facet = new FilterFacet("name", new TermFilter("field", "value")); string json = JsonConvert.SerializeObject(facet); Assert.IsNotNull(json); string expectedJson = "{\"name\":{\"filter\":{\"term\":{\"field\":\"value\"}}}}"; Assert.AreEqual(expectedJson, json); }