public void ToStringContainsFieldComparisonAndValue() { var criteria = new MissingCriteria("thisIsAMissingField"); var result = criteria.ToString(); Assert.Contains(criteria.Field, result); }
public void ConstructorSetsCriteria() { const string field = "myField"; var criteria = new MissingCriteria(field); Assert.Equal(field, criteria.Field); }
public void NamePropertyIsMissing() { var criteria = new MissingCriteria("something"); Assert.Equal("missing", criteria.Name); }
public void BodyContainsFilterMissing() { const string expectedFieldName = "fieldShouldBeMissing"; var termCriteria = new MissingCriteria(expectedFieldName); var formatter = new SearchRequestFormatter(defaultConnection, mapping, new SearchRequest { DocumentType = "type1", Filter = termCriteria }); var body = JObject.Parse(formatter.Body); var field = body.TraverseWithAssert("query", "filtered", "filter", "missing", "field"); Assert.Equal(expectedFieldName, field); }