Ejemplo n.º 1
0
        public void ReturnIqueryableCollectionFromCOMICDataProviderAllMethod()
        {
            //Arrange
            var mockedDataProvider = new Mock <IEfComicShopDataProvider <Comic> >();

            //Act
            var actualComicService =
                new ComicShop.Data.Services.ComicService(mockedDataProvider.Object);

            var actualResult = actualComicService.GetAllComics();

            //Assert
            Assert.That(actualResult, Is.Not.Null.And.InstanceOf <IQueryable <Comic> >());
        }
Ejemplo n.º 2
0
        public void CallComicDataProviderAllMethod()
        {
            //Arrange
            var mockedDataProvider = new Mock <IEfComicShopDataProvider <Comic> >();

            //Act
            var actualComicService =
                new ComicShop.Data.Services.ComicService(mockedDataProvider.Object);

            actualComicService.GetAllComics();

            //Assert
            mockedDataProvider.Verify(
                service => service.All(),
                Times.Once);
        }