コード例 #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));
        }
コード例 #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);
        }
コード例 #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);
        }