public void PendingChanges_DirtyDocuments() { var record = new Record { Id = "0" }; var document = new Document(); var key = mapper.ToKey(record); detector.Expect(d => d.IsModified(record, document)).Return(true); mapper.Expect(m => m.ToDocument(Arg <Record> .Is.Same(record), Arg <Document> .Is.NotNull)); session.DocumentTracker.TrackDocument(key, record, document); record.Id = "1"; session.StageModifiedDocuments(); Assert.That(session.PendingChanges, Is.True, "Should detect modified document."); }
public void PendingChanges_DirtyDocuments() { var record = new Record(); var copy = new Record(); mapper.Expect(m => m.Equals(record, copy)).Return(false); mapper.Expect(m => m.ToDocument(Arg <Record> .Is.Same(record), Arg <Document> .Is.NotNull)); session.DocumentTracker.TrackDocument(record, copy); record.Id = "1"; session.StageModifiedDocuments(); Assert.That(session.PendingChanges, Is.True, "Should detect modified document."); }