コード例 #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();
        }
コード例 #3
0
        public void Begin()
        {
            using (TransactionEventSinkMock.GetMockRepository().Ordered())
            {
                TransactionEventSinkMock.Expect(mock => mock.RaiseRelationChangingEvent(
                                                    DomainObject,
                                                    CollectionEndPoint.Definition,
                                                    _order2,
                                                    null));
                TransactionEventSinkMock.Expect(mock => mock.RaiseRelationChangingEvent(
                                                    DomainObject,
                                                    CollectionEndPoint.Definition,
                                                    null,
                                                    _order3));
            }
            TransactionEventSinkMock.Replay();

            _command.Begin();

            TransactionEventSinkMock.VerifyAllExpectations();
        }
    public void End_NoEvents ()
    {
      TransactionEventSinkMock.Replay();

      _command.End ();
    }
    public void Begin_NoEvents ()
    {
      TransactionEventSinkMock.Replay();

      _command.Begin ();
    }