コード例 #1
0
        public void GetIndexes_WhenItemHasNulledGuidId_ReturnsNoIndex()
        {
            var item = new WithNullableGuidId { StructureId = null };
            var schemaStub = StructureSchemaTestFactory.CreateRealFrom<WithNullableGuidId>();

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

            Assert.AreEqual(0, indexes.Count);
        }
コード例 #2
0
        public void GetIndexes_WhenNullableGuidIdHasValue_ReturnsId()
        {
            var id = Guid.Parse("1F0E8C1D-7AF5-418F-A6F6-A40B7F31CB00");
            var item = new WithNullableGuidId { StructureId = id };
            var schemaStub = StructureSchemaTestFactory.CreateRealFrom<WithNullableGuidId>();

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

            Assert.AreEqual(id, indexes.Single(i => i.Path == "StructureId").Value);
        }
コード例 #3
0
        public void GetIndexes_WhenItemHasNulledGuidId_ReturnsNoIndex()
        {
            var item = new WithNullableGuidId {
                StructureId = null
            };
            var schemaStub = StructureSchemaTestFactory.CreateRealFrom <WithNullableGuidId>();

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

            Assert.AreEqual(0, indexes.Count);
        }
コード例 #4
0
        public void GetIndexes_WhenNullableGuidIdHasValue_ReturnsId()
        {
            var id   = Guid.Parse("1F0E8C1D-7AF5-418F-A6F6-A40B7F31CB00");
            var item = new WithNullableGuidId {
                StructureId = id
            };
            var schemaStub = StructureSchemaTestFactory.CreateRealFrom <WithNullableGuidId>();

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

            Assert.AreEqual(id, indexes.Single(i => i.Path == "StructureId").Value);
        }