public void ReturnIqueryableCollectionFromCreatureDataProviderAllMethod() { //Arrange var mockedDataProvider = new Mock <IEfAquaWorldDataProvider <Creature> >(); //Act var actualCreatureService = new AquaWorld.Data.Services.CreatureService(mockedDataProvider.Object); var actualResult = actualCreatureService.GetAllCreatures(); //Assert Assert.That(actualResult, Is.Not.Null.And.InstanceOf <IQueryable <Creature> >()); }
public void CallCreatureDataProviderAllMethod() { //Arrange var mockedDataProvider = new Mock <IEfAquaWorldDataProvider <Creature> >(); //Act var actualCreatureService = new AquaWorld.Data.Services.CreatureService(mockedDataProvider.Object); actualCreatureService.GetAllCreatures(); //Assert mockedDataProvider.Verify( service => service.All(), Times.Once); }