Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
        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);
        }