예제 #1
0
        public void ReturnIQueryableMovieCollectionWhenIsCalled()
        {
            var mockedMoviesService     = new Mock <IMoviesService>();
            var mockedScreeningService  = new Mock <IFilmScreeningService>();
            var mockedNavigationService = new Mock <INavigationService>();

            var actualAddFilmScreeningPresenter =
                new Presenters.FilmScreeningPresenters.AddFilmScreeningPresenter(
                    mockedScreeningService.Object,
                    mockedMoviesService.Object,
                    mockedNavigationService.Object);

            var result = actualAddFilmScreeningPresenter.GetAllMovies();

            Assert.That(result, Is.Not.Null.And.InstanceOf <IQueryable <Movie> >());
        }
예제 #2
0
        public void CallMoviesServiceGetAllMethod()
        {
            var mockedMoviesService     = new Mock <IMoviesService>();
            var mockedScreeningService  = new Mock <IFilmScreeningService>();
            var mockedNavigationService = new Mock <INavigationService>();

            var actualAddFilmScreeningPresenter =
                new Presenters.FilmScreeningPresenters.AddFilmScreeningPresenter(
                    mockedScreeningService.Object,
                    mockedMoviesService.Object,
                    mockedNavigationService.Object);

            actualAddFilmScreeningPresenter.GetAllMovies();

            mockedMoviesService.Verify(service => service.GetAll(), Times.Once);
        }