public void ThrowWhenParameterUpdatedScreeningIsNull() { var mockedScreeningService = new Mock <IFilmScreeningService>(); string screeningId = "1"; FilmScreening nullScreening = null; var actualUpdateFilmScreeningPresenter = new Presenters.FilmScreeningPresenters.UpdateFilmScreeningPresenter(mockedScreeningService.Object); Assert.That( () => actualUpdateFilmScreeningPresenter.UpdateScreening(screeningId, nullScreening), Throws.InstanceOf <ArgumentNullException>()); }
public void CallFilmScreeningServiceUpdateByIdMethodWithTheSameArguments() { var mockedScreeningService = new Mock <IFilmScreeningService>(); string screeningId = "1"; var mockedScreening = new Mock <FilmScreening>(); var actualUpdateFilmScreeningPresenter = new Presenters.FilmScreeningPresenters.UpdateFilmScreeningPresenter(mockedScreeningService.Object); actualUpdateFilmScreeningPresenter.UpdateScreening(screeningId, mockedScreening.Object); mockedScreeningService.Verify( service => service.UpdateById(screeningId, mockedScreening.Object), Times.Once); }