コード例 #1
0
        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.");
        }
コード例 #2
0
        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.");
        }