Exemplo n.º 1
0
        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> >());
        }
Exemplo n.º 2
0
        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);
        }