Пример #1
0
        public void mementoEntity_using_trackingService_should_undo_a_single_change()
        {
            var memento = new ChangeTrackingService();

            var target = new MementoMockEntity();

            ((IMemento)target).Memento = memento;

            target.FirstName = "Mauro";

            memento.Undo();

            target.FirstName.Should().Be.Null();
        }
Пример #2
0
        public void mementoEntity_using_trackingService_should_undo_and_redo_a_single_change()
        {
            var expected = "Mauro";

            var memento = new ChangeTrackingService();

            var target = new MementoMockEntity();

            ((IMemento)target).Memento = memento;

            target.FirstName = expected;

            memento.Undo();
            memento.Redo();

            target.FirstName.Should().Be.EqualTo(expected);
        }