예제 #1
0
        public void GetMovieFromDBAndSetItInModelThrowsException()
        {
            MockedDummySpecificMovieRepository _mockedDummySpecificMovieRepository = new MockedDummySpecificMovieRepository();
            ISpecificMovieInfoService          _specificMovieInfoService           = new SpecificMovieInfoService(_mockedDummySpecificMovieRepository._specificMovieInfoRepository);

            Assert.Throws <SpecificMovieException>(() => _specificMovieInfoService.GetMovieFromDBAndSetItInModel(0));
        }
예제 #2
0
        public void GetMovieFromDBAndSetItInModelPaseses()
        {
            MockedDummySpecificMovieRepository _mockedDummySpecificMovieRepository = new MockedDummySpecificMovieRepository();
            ISpecificMovieInfoService          _specificMovieInfoService           = new SpecificMovieInfoService(_mockedDummySpecificMovieRepository._specificMovieInfoRepository);

            _specificMovieInfoService.GetMovieFromDBAndSetItInModel(1);
            Assert.AreEqual("Transformers", _specificMovieInfoService.SetMovieInfo().title);
        }
예제 #3
0
        public void SetUpdatedRateInModelPaseses()
        {
            MockedDummySpecificMovieRepository _mockedDummySpecificMovieRepository = new MockedDummySpecificMovieRepository();
            ISpecificMovieInfoService          _specificMovieInfoService           = new SpecificMovieInfoService(_mockedDummySpecificMovieRepository._specificMovieInfoRepository);

            _specificMovieInfoService.GetMovieFromDBAndSetItInModel(1);
            _specificMovieInfoService.SetUpdatedRateInModel();
            Assert.AreEqual(5, _specificMovieInfoService.SetMovieInfo().avgRating);
        }
예제 #4
0
        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);
        }
예제 #5
0
        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);
        }