Пример #1
0
        public void CreateStructure_WhenChildItemWithInheritedNullablesHasValues_IndexesAreCreated()
        {
            Builder = StructureBuilder.Create(c => c.Register <ChildWithNullables>());
            var item = ChildWithNullables.CreatePopulated();

            var structure = Builder.CreateStructure(item);

            Assert.AreEqual(2, structure.Indexes.Count);

            Assert.AreEqual("NullableInt", structure.Indexes[0].Path);
            Assert.AreEqual(typeof(int?), structure.Indexes[0].DataType);
            Assert.AreEqual(item.NullableInt, structure.Indexes[0].Value);

            Assert.AreEqual("NullableGuid", structure.Indexes[1].Path);
            Assert.AreEqual(typeof(Guid?), structure.Indexes[1].DataType);
            Assert.AreEqual(item.NullableGuid, structure.Indexes[1].Value);
        }
        public void CreateStructure_WhenChildItemWithInheritedNullablesHasValues_IndexesAreCreated()
        {
            var schema = StructureSchemaTestFactory.CreateRealFrom <ChildWithNullables>();
            var item   = ChildWithNullables.CreatePopulated();

            var structure = Builder.CreateStructure(item, schema);

            Assert.AreEqual(3, structure.Indexes.Count);
            Assert.AreEqual("StructureId", structure.Indexes[0].Path);

            Assert.AreEqual("NullableInt", structure.Indexes[1].Path);
            Assert.AreEqual(typeof(int?), structure.Indexes[1].DataType);
            Assert.AreEqual(item.NullableInt, structure.Indexes[1].Value);

            Assert.AreEqual("NullableGuid", structure.Indexes[2].Path);
            Assert.AreEqual(typeof(Guid?), structure.Indexes[2].DataType);
            Assert.AreEqual(item.NullableGuid, structure.Indexes[2].Value);
        }