public void Document_WithConventionId_WhenAccessingId_ShouldMatchTheContent() { string id = "doc-id"; var myContent = new TestContentStringId { Id = id, AnyNumber = 5 }; var myDoc = new Document <TestContentStringId>(myContent); Assert.Equal(id, myDoc.Id); }
public void Document_WithoutMatchingIdTypes_WhenAccessingId_ShouldThrowException() { string id = "doc-id"; var myContent = new TestContentStringId { Id = id, AnyNumber = 5 }; var myDoc = new Document <TestContentStringId, Guid>(myContent); Assert.Throws <InvalidOperationException>(() => myDoc.Id); }