public void ThrowsWhenNegativeHits() { const int total = -1; var response = new ElasticResponse { hits = new Hits { hits = new List <Hit>(), total = total } }; var materializer = new AnyElasticMaterializer(); Assert.Throws <ArgumentOutOfRangeException>(() => materializer.Materialize(response)); }
public void ReturnsTrueWhenOneOrMoreHits(int total) { var response = new ElasticResponse { hits = new Hits { hits = new List <Hit>(), total = total } }; var materializer = new AnyElasticMaterializer(); var actual = materializer.Materialize(response); Assert.Equal(true, actual); }
public void ReturnsFalseWhenNoHits() { const int total = 0; var response = new ElasticResponse { hits = new Hits { hits = new List <Hit>(), total = total } }; var materializer = new AnyElasticMaterializer(); var actual = materializer.Materialize(response); Assert.Equal(false, actual); }