Example #1
0
        public void ReturnIQueryableMoviesCollectionProvidedFromMovieRepositoryAllMethod()
        {
            var mockedMovieRepo = new Mock <IRepository <Movie> >();

            var actualMoviesService =
                new Cinema.Data.Services.MoviesService(mockedMovieRepo.Object);

            var result = actualMoviesService.GetAll();

            Assert.That(result, Is.Not.Null.And.InstanceOf <IQueryable <Movie> >());
        }
Example #2
0
        public void CallMovieRepositoryAllMethod()
        {
            var mockedMovieRepo = new Mock <IRepository <Movie> >();

            var actualMoviesService =
                new Cinema.Data.Services.MoviesService(mockedMovieRepo.Object);

            actualMoviesService.GetAll();

            mockedMovieRepo.Verify(service => service.All(), Times.Once);
        }