Exemplo n.º 1
0
        public void GetData()
        {
            var fakeResult = new ReadOnlyCollectionDataDecorator(new DomainObjectCollectionData());

            _loadStateMock.Expect(mock => mock.GetData(_endPoint)).Return(fakeResult);
            _loadStateMock.Replay();

            var result = _endPoint.GetData();

            _loadStateMock.VerifyAllExpectations();
            Assert.That(result, Is.SameAs(fakeResult));
        }
        public void SetCollection_DataStrategy_OfNewOpposites()
        {
            var newOpposites = new OrderCollection {
                _order2
            };

            SetCollectionAndNotify(_customerEndPoint, newOpposites);

            // New collection now has a delegating data store...
            DomainObjectCollectionDataTestHelper.CheckAssociatedCollectionStrategy(newOpposites, typeof(Order), _customerEndPoint.ID);

            // ... and the end-point now has data newOpposites had before!
            Assert.That(_customerEndPoint.GetData(), Is.EqualTo(new[] { _order2 }));
            Assert.That(newOpposites, Is.EqualTo(new[] { _order2 }));
        }