Exemple #1
0
        public void AllowCallingFilmScreeningServiceGetAllScreeningsByDateMethodWithNullOrEmptyParameters(string nullParameter)
        {
            var mockedScreeningService = new Mock <IFilmScreeningService>();

            var actualGetFilmScreeningsPresenter =
                new Presenters.FilmScreeningPresenters.GetFilmScreeningsPresenter(mockedScreeningService.Object);

            actualGetFilmScreeningsPresenter.GetScreeningsByDate(nullParameter);

            mockedScreeningService.Verify(service => service.GetAllScreeningsByDate(nullParameter), Times.Once);
        }
Exemple #2
0
        public void CallFilmScreeningServiceGetAllScreeningsByDateMethodWithTheSameDate(string validDate)
        {
            var mockedScreeningService = new Mock <IFilmScreeningService>();

            var actualGetFilmScreeningsPresenter =
                new Presenters.FilmScreeningPresenters.GetFilmScreeningsPresenter(mockedScreeningService.Object);

            actualGetFilmScreeningsPresenter.GetScreeningsByDate(validDate);

            mockedScreeningService.Verify(service => service.GetAllScreeningsByDate(validDate), Times.Once);
        }
Exemple #3
0
        public void ReturnIQueryableFilmSCreeningsCollectionWhenIsCalled()
        {
            var    mockedScreeningService = new Mock <IFilmScreeningService>();
            string validDate = "3/08/2017";

            var actualGetFilmScreeningsPresenter =
                new Presenters.FilmScreeningPresenters.GetFilmScreeningsPresenter(mockedScreeningService.Object);

            var result = actualGetFilmScreeningsPresenter.GetScreeningsByDate(validDate);

            Assert.That(result, Is.Not.Null.And.InstanceOf <IQueryable <FilmScreening> >());
        }