示例#1
0
        public void When_undoing_a_merge_with_modifications_after()
        {
            var ms      = new MergeService();
            var mergeID = ms.Merge(_primary, _secondary);

            _primary.PushEvent(new MobilePhoneChangedEvent("0744 4444 444"));
            _store.Save("Users", _primary);

            var user = ms.UndoMerge(_store, 1, mergeID);

            var undo = user.GetUncommittedEvents().ToList();

            undo.ShouldSatisfyAllConditions(
                () => undo.OfType <NameMergeRevertedEvent>().Single().Name.ShouldBe("Andy"),
                () => undo.Count.ShouldBe(1)
                );
        }
示例#2
0
        public void When_undoing_a_merge()
        {
            var ms      = new MergeService();
            var mergeID = ms.Merge(_primary, _secondary);

            _store.Save("Users", _primary);

            var user = ms.UndoMerge(_store, 1, mergeID);

            var undo = user.GetUncommittedEvents().ToList();

            undo.ShouldSatisfyAllConditions(
                () => undo.OfType <NameMergeRevertedEvent>().Single().Name.ShouldBe("Andy"),
                () => undo.OfType <MobilePhoneMergeRevertedEvent>().Single().MobileNumber.ShouldBe("0798 1234 123"),
                () => undo.Count.ShouldBe(2)
                );
        }