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); }
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); }
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); }
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); }