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