Ejemplo n.º 1
0
        public void EndPointLoader_Serializable()
        {
            var endPointLoader = new CollectionEndPoint.EndPointLoader(new SerializableLazyLoaderFake());

            var deserializedInstance = FlattenedSerializer.SerializeAndDeserialize(endPointLoader);

            Assert.That(deserializedInstance.LazyLoader, Is.Not.Null);
        }
Ejemplo n.º 2
0
        public void EndPointLoader_LoadEndPointAndGetNewState()
        {
            var endPointLoader = new CollectionEndPoint.EndPointLoader(_lazyLoaderMock);
            var loadStateFake  = MockRepository.GenerateStub <ICollectionEndPointLoadState> ();

            _lazyLoaderMock
            .Expect(mock => mock.LoadLazyCollectionEndPoint(_customerEndPointID))
            .WhenCalled(mi => CollectionEndPointTestHelper.SetLoadState(_endPoint, loadStateFake));

            _lazyLoaderMock.Replay();

            var result = endPointLoader.LoadEndPointAndGetNewState(_endPoint);

            _lazyLoaderMock.VerifyAllExpectations();
            Assert.That(result, Is.SameAs(loadStateFake));
        }