public void SetDataFromSubTransaction()
        {
            var counter = new OrderedExpectationCounter();

            _collectionEndPointMock.Stub(stub => stub.GetCollectionEventRaiser()).Return(_eventRaiserMock);

            var sourceDataManager = MockRepository.GenerateStub <ICollectionEndPointDataManager> ();
            var sourceLoadState   = new CompleteCollectionEndPointLoadState(sourceDataManager, _endPointProviderStub, _transactionEventSinkStub);

            _dataManagerMock.Expect(mock => mock.SetDataFromSubTransaction(sourceDataManager, _endPointProviderStub)).Ordered(counter);
            _dataManagerMock.Replay();

            _eventRaiserMock.Expect(mock => mock.WithinReplaceData()).Ordered(counter);
            _eventRaiserMock.Replay();

            _loadState.SetDataFromSubTransaction(_collectionEndPointMock, sourceLoadState);

            _dataManagerMock.VerifyAllExpectations();
            _eventRaiserMock.VerifyAllExpectations();
        }
Exemple #2
0
        public void Clear()
        {
            using (_mockRepository.Ordered())
            {
                _eventRaiserMock.Expect(mock => mock.BeginRemove(0, _order1)).WhenCalled(mi => Assert.That(_eventRaisingDecoratorWithRealContent.Count, Is.EqualTo(3)));
                _eventRaiserMock.Expect(mock => mock.BeginRemove(1, _order3)).WhenCalled(mi => Assert.That(_eventRaisingDecoratorWithRealContent.Count, Is.EqualTo(3)));
                _eventRaiserMock.Expect(mock => mock.BeginRemove(2, _order4)).WhenCalled(mi => Assert.That(_eventRaisingDecoratorWithRealContent.Count, Is.EqualTo(3)));

                _eventRaiserMock.Expect(mock => mock.EndRemove(2, _order4)).WhenCalled(mi => Assert.That(_eventRaisingDecoratorWithRealContent.Count, Is.EqualTo(0)));
                _eventRaiserMock.Expect(mock => mock.EndRemove(1, _order3)).WhenCalled(mi => Assert.That(_eventRaisingDecoratorWithRealContent.Count, Is.EqualTo(0)));
                _eventRaiserMock.Expect(mock => mock.EndRemove(0, _order1)).WhenCalled(mi => Assert.That(_eventRaisingDecoratorWithRealContent.Count, Is.EqualTo(0)));
            }

            _eventRaiserMock.Replay();

            _eventRaisingDecoratorWithRealContent.Clear();

            _eventRaiserMock.VerifyAllExpectations();
        }