public void GetMovieFromDBAndSetItInModelThrowsException() { MockedDummySpecificMovieRepository _mockedDummySpecificMovieRepository = new MockedDummySpecificMovieRepository(); ISpecificMovieInfoService _specificMovieInfoService = new SpecificMovieInfoService(_mockedDummySpecificMovieRepository._specificMovieInfoRepository); Assert.Throws <SpecificMovieException>(() => _specificMovieInfoService.GetMovieFromDBAndSetItInModel(0)); }
public void GetMovieFromDBAndSetItInModelPaseses() { MockedDummySpecificMovieRepository _mockedDummySpecificMovieRepository = new MockedDummySpecificMovieRepository(); ISpecificMovieInfoService _specificMovieInfoService = new SpecificMovieInfoService(_mockedDummySpecificMovieRepository._specificMovieInfoRepository); _specificMovieInfoService.GetMovieFromDBAndSetItInModel(1); Assert.AreEqual("Transformers", _specificMovieInfoService.SetMovieInfo().title); }
public void SetUpdatedRateInModelPaseses() { MockedDummySpecificMovieRepository _mockedDummySpecificMovieRepository = new MockedDummySpecificMovieRepository(); ISpecificMovieInfoService _specificMovieInfoService = new SpecificMovieInfoService(_mockedDummySpecificMovieRepository._specificMovieInfoRepository); _specificMovieInfoService.GetMovieFromDBAndSetItInModel(1); _specificMovieInfoService.SetUpdatedRateInModel(); Assert.AreEqual(5, _specificMovieInfoService.SetMovieInfo().avgRating); }
public void DeleteUserRateDeletesRate() { MockedDummySpecificMovieRepository _mockedDummySpecificMovieRepository = new MockedDummySpecificMovieRepository(); ISpecificMovieInfoService _specificMovieInfoService = new SpecificMovieInfoService(_mockedDummySpecificMovieRepository._specificMovieInfoRepository); _specificMovieInfoService.GetMovieFromDBAndSetItInModel(1); _specificMovieInfoService.DeleteUserRate(1); Assert.AreEqual(4.5, _mockedDummySpecificMovieRepository.currentMovie.AVGRating); }
public void MovieRemoverRemoves() { MockedDummySpecificMovieRepository _mockedDummySpecificMovieRepository = new MockedDummySpecificMovieRepository(); ISpecificMovieInfoService _specificMovieInfoService = new SpecificMovieInfoService(_mockedDummySpecificMovieRepository._specificMovieInfoRepository); _specificMovieInfoService.GetMovieFromDBAndSetItInModel(1); _specificMovieInfoService.MovieRemover(1); Assert.AreEqual(2, _mockedDummySpecificMovieRepository.watchlist.Count); }