Beispiel #1
0
        public virtual void Begin()
        {
            TransactionEventSinkWithMock.Expect(mock => mock.RaiseRelationChangingEvent(
                                                    _endPoint.GetDomainObject(),
                                                    _endPoint.Definition,
                                                    _oldRelatedObject,
                                                    _newRelatedObject));
            TransactionEventSinkWithMock.Replay();

            _command.Begin();

            TransactionEventSinkWithMock.VerifyAllExpectations();
        }
        public override void SetUp()
        {
            base.SetUp();

            _endPointID   = RelationEndPointObjectMother.CreateRelationEndPointID(DomainObjectIDs.Order1, "OrderTicket");
            _endPoint     = RelationEndPointObjectMother.CreateObjectEndPoint(_endPointID, DomainObjectIDs.OrderTicket1);
            _domainObject = _endPoint.GetDomainObject();

            _oppositeObjectNullSetterCalled = false;
            _oppositeObjectNullSetter       = () =>
            {
                _oppositeObjectNullSetterCalled = true;
            };

            _transactionEventSinkWithMock = MockRepository.GenerateStrictMock <IClientTransactionEventSink>();
            _command = new ObjectEndPointDeleteCommand(_endPoint, _oppositeObjectNullSetter, _transactionEventSinkWithMock);
        }