Beispiel #1
0
        public void GetIndexes_WhenItemWithArraysBeingNull_ReturnesNoIndexes()
        {
            var item = new WithArray
            {
                IntValues         = null,
                NullableIntValues = null,
                StringValues      = null
            };

            var schemaStub = StructureSchemaTestFactory.CreateRealFrom <WithArray>();

            var factory = new StructureIndexesFactory();
            var indexes = factory.CreateIndexes(schemaStub, item).ToList();

            indexes.Should().BeEmpty();
        }
Beispiel #2
0
        public void GetIndexes_WhenArrayOfComplexWithChildBeingNull_ReturnesNoIndexes()
        {
            var item = new WithComplexArray
            {
                Items = new[] { new Complex {
                                    Name = null, Value = 42
                                } }
            };

            var schemaStub = StructureSchemaTestFactory.CreateRealFrom <WithComplexArray>();

            var factory = new StructureIndexesFactory();
            var indexes = factory.CreateIndexes(schemaStub, item).ToList();

            indexes.Count.Should().Be(1);
            indexes[0].Value.Should().Be(42);
        }