public void GetCollection_DoesNotLoadData() { _customerEndPoint.MarkDataIncomplete(); Assert.That(_customerEndPoint.IsDataComplete, Is.False); Dev.Null = _customerEndPoint.Collection; Assert.That(_customerEndPoint.IsDataComplete, Is.False); }
public void MarkDataIncomplete() { Action stateSetter = null; _loadStateMock .Expect(mock => mock.MarkDataIncomplete(Arg.Is(_endPoint), Arg <Action> .Is.Anything)) .WhenCalled(mi => { stateSetter = (Action)mi.Arguments[1]; }); _loadStateMock.Replay(); _endPoint.MarkDataIncomplete(); _loadStateMock.VerifyAllExpectations(); Assert.That(CollectionEndPointTestHelper.GetLoadState(_endPoint), Is.SameAs(_loadStateMock)); stateSetter(); var newLoadState = CollectionEndPointTestHelper.GetLoadState(_endPoint); Assert.That(newLoadState, Is.TypeOf(typeof(IncompleteCollectionEndPointLoadState))); Assert.That( ((IncompleteCollectionEndPointLoadState)newLoadState).EndPointLoader, Is.TypeOf <CollectionEndPoint.EndPointLoader> ().With.Property <CollectionEndPoint.EndPointLoader> (l => l.LazyLoader).SameAs(_lazyLoaderMock)); }