Ejemplo n.º 1
0
        public void CreateStructure_When_structure_has_empty_collection_with_uniques_It_should_create_structure_with_index_for_other_members()
        {
            var schema = StructureSchemaTestFactory.CreateRealFrom <WithCollectionOfUniques>();
            var item   = new WithCollectionOfUniques {
                Temp = "Foo", Values = new List <UniqueItem>()
            };

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

            Assert.AreEqual(2, structure.Indexes.Count);
            Assert.AreEqual("StructureId", structure.Indexes[0].Path);
            Assert.AreEqual("Temp", structure.Indexes[1].Path);
        }
        public void CreateStructure_When_structure_has_null_collection_with_uniques_It_should_create_structure_with_index_for_other_members()
        {
            var schema = StructureSchemaTestFactory.CreateRealFrom<WithCollectionOfUniques>();
            var item = new WithCollectionOfUniques { Temp = "Foo", Values = null };

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

            Assert.AreEqual(2, structure.Indexes.Count);
            Assert.AreEqual("StructureId", structure.Indexes[0].Path);
            Assert.AreEqual("Temp", structure.Indexes[1].Path);
        }