protected override void ExpectResponse(IGetMappingResponse response)
        {
            response.ShouldBeValid();

            var visitor = new TestVisitor();

            response.Accept(visitor);

            visitor.CountsShouldContainKeyAndCountBe("type", 1);
            visitor.CountsShouldContainKeyAndCountBe("join", 1);
            visitor.CountsShouldContainKeyAndCountBe("object", 7);
            visitor.CountsShouldContainKeyAndCountBe("date", 4);
            visitor.CountsShouldContainKeyAndCountBe("text", 18);
            visitor.CountsShouldContainKeyAndCountBe("keyword", 17);
            visitor.CountsShouldContainKeyAndCountBe("ip", 2);
            visitor.CountsShouldContainKeyAndCountBe("number", 7);
            visitor.CountsShouldContainKeyAndCountBe("geo_point", 3);
            visitor.CountsShouldContainKeyAndCountBe("completion", 2);
            visitor.CountsShouldContainKeyAndCountBe("nested", 1);
            visitor.CountsShouldContainKeyAndCountBe("date_range", 1);
            visitor.CountsShouldContainKeyAndCountBe("float_range", 1);
            visitor.CountsShouldContainKeyAndCountBe("integer_range", 1);
            visitor.CountsShouldContainKeyAndCountBe("double_range", 1);
            visitor.CountsShouldContainKeyAndCountBe("long_range", 1);
        }
예제 #2
0
        //hide
        private static void AssertVisitedProperties(GetMappingResponse response)
        {
            var visitor = new TestVisitor();
            var b       = TestClient.Configuration.Random.SourceSerializer;

            response.Accept(visitor);
            visitor.CountsShouldContainKeyAndCountBe("type", 1);
            visitor.CountsShouldContainKeyAndCountBe("text", b ? 18 : 17);
            visitor.CountsShouldContainKeyAndCountBe("keyword", b ? 19 : 18);
            visitor.CountsShouldContainKeyAndCountBe("object", 8);
            visitor.CountsShouldContainKeyAndCountBe("number", 9);
            visitor.CountsShouldContainKeyAndCountBe("ip", 2);
            visitor.CountsShouldContainKeyAndCountBe("geo_point", 3);
            visitor.CountsShouldContainKeyAndCountBe("date", 4);
            visitor.CountsShouldContainKeyAndCountBe("join", 1);
            visitor.CountsShouldContainKeyAndCountBe("completion", 2);
            visitor.CountsShouldContainKeyAndCountBe("date_range", 1);
            visitor.CountsShouldContainKeyAndCountBe("double_range", 1);
            visitor.CountsShouldContainKeyAndCountBe("float_range", 1);
            visitor.CountsShouldContainKeyAndCountBe("integer_range", 1);
            visitor.CountsShouldContainKeyAndCountBe("long_range", 1);
            visitor.CountsShouldContainKeyAndCountBe("ip_range", 1);
            visitor.CountsShouldContainKeyAndCountBe("nested", 1);
            visitor.CountsShouldContainKeyAndCountBe("rank_feature", 1);
        }
        protected override void ExpectResponse(IGetMappingResponse response)
        {
            response.ShouldBeValid();

            var visitor = new TestVisitor();

            response.Accept(visitor);

            visitor.CountsShouldContainKeyAndCountBe("type", 1);
            //ranges property is ignored on versions before 5.2.0
            var supportsRanges = TestClient.VersionUnderTestSatisfiedBy(">=5.2.0");

            visitor.CountsShouldContainKeyAndCountBe("object", supportsRanges ? 5 : 4);
            visitor.CountsShouldContainKeyAndCountBe("date", 4);
            visitor.CountsShouldContainKeyAndCountBe("text", 11);
            visitor.CountsShouldContainKeyAndCountBe("keyword", 10);
            visitor.CountsShouldContainKeyAndCountBe("ip", 1);
            visitor.CountsShouldContainKeyAndCountBe("number", 3);
            visitor.CountsShouldContainKeyAndCountBe("geo_point", 2);
            visitor.CountsShouldContainKeyAndCountBe("completion", 2);
            visitor.CountsShouldContainKeyAndCountBe("nested", 1);
            if (supportsRanges)
            {
                visitor.CountsShouldContainKeyAndCountBe("date_range", 1);
                visitor.CountsShouldContainKeyAndCountBe("float_range", 1);
                visitor.CountsShouldContainKeyAndCountBe("integer_range", 1);
                visitor.CountsShouldContainKeyAndCountBe("double_range", 1);
                visitor.CountsShouldContainKeyAndCountBe("long_range", 1);
            }
        }
예제 #4
0
        //hide
        private static void AssertVisitedProperties(GetMappingResponse response)
        {
            var visitor = new TestVisitor();
            var b       = TestClient.Configuration.Random.SourceSerializer;

            var supportsFlattenedType   = TestConfiguration.Instance.InRange(">=7.3.0");
            var supportsConstantKeyword = TestConfiguration.Instance.InRange(">=7.7.0");

            var keywordCount = b ? 19 : 18;

            if (!supportsConstantKeyword)
            {
                keywordCount++;
            }

            response.Accept(visitor);
            visitor.CountsShouldContainKeyAndCountBe("type", 1);
            visitor.CountsShouldContainKeyAndCountBe("text", b ? 18 : 17);
            visitor.CountsShouldContainKeyAndCountBe("keyword", keywordCount);
            visitor.CountsShouldContainKeyAndCountBe("object", supportsFlattenedType? 8 : 9);
            visitor.CountsShouldContainKeyAndCountBe("number", 9);
            visitor.CountsShouldContainKeyAndCountBe("ip", 2);
            visitor.CountsShouldContainKeyAndCountBe("geo_point", 3);
            visitor.CountsShouldContainKeyAndCountBe("date", 4);
            visitor.CountsShouldContainKeyAndCountBe("join", 1);
            visitor.CountsShouldContainKeyAndCountBe("completion", 2);
            visitor.CountsShouldContainKeyAndCountBe("date_range", 1);
            visitor.CountsShouldContainKeyAndCountBe("double_range", 1);
            visitor.CountsShouldContainKeyAndCountBe("float_range", 1);
            visitor.CountsShouldContainKeyAndCountBe("integer_range", 1);
            visitor.CountsShouldContainKeyAndCountBe("long_range", 1);
            visitor.CountsShouldContainKeyAndCountBe("ip_range", 1);
            visitor.CountsShouldContainKeyAndCountBe("nested", 1);
            visitor.CountsShouldContainKeyAndCountBe("rank_feature", 1);

            if (supportsFlattenedType)
            {
                visitor.CountsShouldContainKeyAndCountBe("flattened", 1);
            }

            if (supportsConstantKeyword)
            {
                visitor.CountsShouldContainKeyAndCountBe("constant_keyword", 1);
            }
        }
        protected override void ExpectResponse(IGetMappingResponse response)
        {
            response.IsValid.Should().BeTrue();

            var visitor = new TestVisitor();

            response.Accept(visitor);

            visitor.CountsShouldContainKeyAndCountBe("type", 1);
            visitor.CountsShouldContainKeyAndCountBe("object", 2);
            visitor.CountsShouldContainKeyAndCountBe("date", 4);
            visitor.CountsShouldContainKeyAndCountBe("string", 17);
            visitor.CountsShouldContainKeyAndCountBe("ip", 1);
            visitor.CountsShouldContainKeyAndCountBe("number", 2);
            visitor.CountsShouldContainKeyAndCountBe("geo_point", 2);
            visitor.CountsShouldContainKeyAndCountBe("completion", 2);
            visitor.CountsShouldContainKeyAndCountBe("nested", 1);
        }