public void ThrowArgumentExceptionWhenParamterIdIsNotNumber() { var mockedMovieRepo = new Mock <IRepository <Movie> >(); string stringId = "abc"; var actualMoviesService = new Cinema.Data.Services.MoviesService(mockedMovieRepo.Object); Assert.That( () => actualMoviesService.GetById(stringId), Throws.ArgumentException); }
public void CallMoviesRepoGetByIdMethodWithSameParamterId() { var mockedMovieRepo = new Mock <IRepository <Movie> >(); string stringId = "1"; int intId = 1; var actualMoviesService = new Cinema.Data.Services.MoviesService(mockedMovieRepo.Object); actualMoviesService.GetById(stringId); mockedMovieRepo.Verify(service => service.GetById(intId), Times.Once); }