示例#1
0
        public void End()
        {
            CollectionMockEventReceiver.Expect(mock => mock.Deleted()).WithCurrentTransaction(Transaction);

            _command.End();

            TransactionEventSinkMock.AssertWasNotCalled(mock => mock.RaiseRelationChangedEvent(
                                                            Arg <DomainObject> .Is.Anything,
                                                            Arg <IRelationEndPointDefinition> .Is.Anything,
                                                            Arg <DomainObject> .Is.Anything,
                                                            Arg <DomainObject> .Is.Anything));

            CollectionMockEventReceiver.VerifyAllExpectations();
        }
示例#2
0
        public void End()
        {
            var counter = new OrderedExpectationCounter();

            TransactionEventSinkMock
            .Expect(mock => mock.RaiseRelationChangedEvent(DomainObject, CollectionEndPoint.Definition, _removedRelatedObject, null))
            .Ordered(counter);
            CollectionMockEventReceiver
            .Expect(mock => mock.Removed(_removedRelatedObject))
            .WhenCalledOrdered(counter, mi => Assert.That(ClientTransaction.Current, Is.SameAs(Transaction)));

            _command.End();

            TransactionEventSinkMock.VerifyAllExpectations();
            CollectionMockEventReceiver.VerifyAllExpectations();
        }