예제 #1
0
        public void UserAlreadyRatedReturnsTrues()
        {
            MockedDummySpecificMovieService _mockedDummyService = new MockedDummySpecificMovieService();
            MockedDummySpecificMovieView    _mockedDummyView    = new MockedDummySpecificMovieView();
            ISpecificMovieInfoPresenter     _presenter          = new SpecificMovieInfoPresenter(_mockedDummyView, _mockedDummyService._specificMovieService);

            Assert.AreEqual(true, _presenter.UserAlreadyRated());
        }
예제 #2
0
        public void GetUserNameGets()
        {
            MockedDummySpecificMovieService _mockedDummyService = new MockedDummySpecificMovieService();
            MockedDummySpecificMovieView    _mockedDummyView    = new MockedDummySpecificMovieView();
            ISpecificMovieInfoPresenter     _presenter          = new SpecificMovieInfoPresenter(_mockedDummyView, _mockedDummyService._specificMovieService);

            Assert.AreEqual("Zak", _presenter.GetUserName());
        }
예제 #3
0
        public void UserHasMovieInWatchListReturnsTrue()
        {
            MockedDummySpecificMovieService _mockedDummyService = new MockedDummySpecificMovieService();
            MockedDummySpecificMovieView    _mockedDummyView    = new MockedDummySpecificMovieView();
            ISpecificMovieInfoPresenter     _presenter          = new SpecificMovieInfoPresenter(_mockedDummyView, _mockedDummyService._specificMovieService);

            Assert.AreEqual(true, _presenter.UserHasMovieInWatchList());
        }
예제 #4
0
        public void GetLastCommentGets()
        {
            MockedDummySpecificMovieService _mockedDummyService = new MockedDummySpecificMovieService();
            MockedDummySpecificMovieView    _mockedDummyView    = new MockedDummySpecificMovieView();
            ISpecificMovieInfoPresenter     _presenter          = new SpecificMovieInfoPresenter(_mockedDummyView, _mockedDummyService._specificMovieService);

            Assert.AreEqual(_mockedDummyService.comments.Last(), _presenter.GetLastComment());
        }
예제 #5
0
        public void AddCommentInDBAdds()
        {
            MockedDummySpecificMovieService _mockedDummyService = new MockedDummySpecificMovieService();
            MockedDummySpecificMovieView    _mockedDummyView    = new MockedDummySpecificMovieView();
            ISpecificMovieInfoPresenter     _presenter          = new SpecificMovieInfoPresenter(_mockedDummyView, _mockedDummyService._specificMovieService);

            _presenter.AddCommentInDB("123124");
            Assert.AreEqual(3, _mockedDummyService.comments.Count);
        }
예제 #6
0
        public void SetCommentsForTheMovieSetsComments()
        {
            MockedDummySpecificMovieService _mockedDummyService = new MockedDummySpecificMovieService();
            MockedDummySpecificMovieView    _mockedDummyView    = new MockedDummySpecificMovieView();
            ISpecificMovieInfoPresenter     _presenter          = new SpecificMovieInfoPresenter(_mockedDummyView, _mockedDummyService._specificMovieService);

            _presenter.SetCommentsForTheMovie();
            Assert.AreEqual(_mockedDummyService.comments, _mockedDummyView.comments);
        }
예제 #7
0
        public void GetUserNameThrowsException()
        {
            MockedDummySpecificMovieService _mockedDummyService = new MockedDummySpecificMovieService();
            MockedDummySpecificMovieView    _mockedDummyView    = new MockedDummySpecificMovieView();
            ISpecificMovieInfoPresenter     _presenter          = new SpecificMovieInfoPresenter(_mockedDummyView, _mockedDummyService._specificMovieService);

            _mockedDummyService.error = true;
            Assert.AreNotEqual("Zak", _presenter.GetUserName());
        }
예제 #8
0
        public void AddMovieINWatchListAdds()
        {
            MockedDummySpecificMovieService _mockedDummyService = new MockedDummySpecificMovieService();
            MockedDummySpecificMovieView    _mockedDummyView    = new MockedDummySpecificMovieView();
            ISpecificMovieInfoPresenter     _presenter          = new SpecificMovieInfoPresenter(_mockedDummyView, _mockedDummyService._specificMovieService);

            _presenter.DeleteMovieFromWatchList();
            Assert.AreEqual(2, _mockedDummyService.watchlist.Count);
        }
예제 #9
0
        public void GetUserPositionGets()
        {
            MockedDummySpecificMovieService _mockedDummyService = new MockedDummySpecificMovieService();
            MockedDummySpecificMovieView    _mockedDummyView    = new MockedDummySpecificMovieView();
            ISpecificMovieInfoPresenter     _presenter          = new SpecificMovieInfoPresenter(_mockedDummyView, _mockedDummyService._specificMovieService);

            _presenter.GetUserPosition();
            Assert.AreEqual("admin", _mockedDummyView.userPosition);
        }
예제 #10
0
        public void DeleteRateDeletes()
        {
            MockedDummySpecificMovieService _mockedDummyService = new MockedDummySpecificMovieService();
            MockedDummySpecificMovieView    _mockedDummyView    = new MockedDummySpecificMovieView();
            ISpecificMovieInfoPresenter     _presenter          = new SpecificMovieInfoPresenter(_mockedDummyView, _mockedDummyService._specificMovieService);

            _presenter.DeleteRate();
            Assert.AreEqual(_mockedDummyService._movie.AVGRating, _mockedDummyView.movieAVGRate);
        }
예제 #11
0
        public void SetUserRateReturnsRate()
        {
            MockedDummySpecificMovieService _mockedDummyService = new MockedDummySpecificMovieService();
            MockedDummySpecificMovieView    _mockedDummyView    = new MockedDummySpecificMovieView();
            ISpecificMovieInfoPresenter     _presenter          = new SpecificMovieInfoPresenter(_mockedDummyView, _mockedDummyService._specificMovieService);

            _presenter.SetUserRate();
            Assert.AreEqual(3, _mockedDummyView.userRate);
        }
예제 #12
0
        public void UserHasMovieInWatchListThrowsException()
        {
            MockedDummySpecificMovieService _mockedDummyService = new MockedDummySpecificMovieService();
            MockedDummySpecificMovieView    _mockedDummyView    = new MockedDummySpecificMovieView();
            ISpecificMovieInfoPresenter     _presenter          = new SpecificMovieInfoPresenter(_mockedDummyView, _mockedDummyService._specificMovieService);

            _mockedDummyService.error = true;

            Assert.AreNotEqual(true, _presenter.UserHasMovieInWatchList());
        }
예제 #13
0
        public void AddMovieINWatchListThrowsException()
        {
            MockedDummySpecificMovieService _mockedDummyService = new MockedDummySpecificMovieService();
            MockedDummySpecificMovieView    _mockedDummyView    = new MockedDummySpecificMovieView();
            ISpecificMovieInfoPresenter     _presenter          = new SpecificMovieInfoPresenter(_mockedDummyView, _mockedDummyService._specificMovieService);

            _mockedDummyService.error = true;
            _presenter.AddMovieINWatchList();
            Assert.AreNotEqual(4, _mockedDummyService.watchlist.Count);
        }
예제 #14
0
        public void SetCommentsForTheMovieThrowsException()
        {
            MockedDummySpecificMovieService _mockedDummyService = new MockedDummySpecificMovieService();
            MockedDummySpecificMovieView    _mockedDummyView    = new MockedDummySpecificMovieView();
            ISpecificMovieInfoPresenter     _presenter          = new SpecificMovieInfoPresenter(_mockedDummyView, _mockedDummyService._specificMovieService);

            _mockedDummyService.error = true;
            _presenter.SetCommentsForTheMovie();
            Assert.AreNotEqual(_mockedDummyService.comments, _mockedDummyView.comments);
        }
예제 #15
0
        public void RateMovieRatesThrowsException()
        {
            MockedDummySpecificMovieService _mockedDummyService = new MockedDummySpecificMovieService();
            MockedDummySpecificMovieView    _mockedDummyView    = new MockedDummySpecificMovieView();
            ISpecificMovieInfoPresenter     _presenter          = new SpecificMovieInfoPresenter(_mockedDummyView, _mockedDummyService._specificMovieService);

            _mockedDummyService.error = true;
            _presenter.RateMovie(1);
            Assert.AreNotEqual(4, _mockedDummyService.rates.Count);
        }
예제 #16
0
        public void RateMovieRates()
        {
            MockedDummySpecificMovieService _mockedDummyService = new MockedDummySpecificMovieService();
            MockedDummySpecificMovieView    _mockedDummyView    = new MockedDummySpecificMovieView();
            ISpecificMovieInfoPresenter     _presenter          = new SpecificMovieInfoPresenter(_mockedDummyView, _mockedDummyService._specificMovieService);

            _presenter.RateMovie(1);

            Assert.AreEqual(4, _mockedDummyService.rates.Count);
        }
예제 #17
0
        public void DeleteRateThrowsException()
        {
            MockedDummySpecificMovieService _mockedDummyService = new MockedDummySpecificMovieService();
            MockedDummySpecificMovieView    _mockedDummyView    = new MockedDummySpecificMovieView();
            ISpecificMovieInfoPresenter     _presenter          = new SpecificMovieInfoPresenter(_mockedDummyView, _mockedDummyService._specificMovieService);

            _mockedDummyService.error = true;
            _presenter.DeleteRate();
            Assert.AreNotEqual(_mockedDummyService._movie.AVGRating, _mockedDummyView.movieAVGRate);
        }
예제 #18
0
        public void SetUserRateThrowsException()
        {
            MockedDummySpecificMovieService _mockedDummyService = new MockedDummySpecificMovieService();
            MockedDummySpecificMovieView    _mockedDummyView    = new MockedDummySpecificMovieView();
            ISpecificMovieInfoPresenter     _presenter          = new SpecificMovieInfoPresenter(_mockedDummyView, _mockedDummyService._specificMovieService);

            _mockedDummyService.error = true;
            _presenter.SetUserRate();
            Assert.AreNotEqual(3, _mockedDummyView.userRate);
        }
예제 #19
0
        public void GetInfoForMovieThrowsException()
        {
            MockedDummySpecificMovieService _mockedDummyService = new MockedDummySpecificMovieService();
            MockedDummySpecificMovieView    _mockedDummyView    = new MockedDummySpecificMovieView();
            ISpecificMovieInfoPresenter     _presenter          = new SpecificMovieInfoPresenter(_mockedDummyView, _mockedDummyService._specificMovieService);

            _mockedDummyService.error = true;
            _presenter.GetInfoForMovie(1);
            Assert.AreNotEqual(_mockedDummyService._movie.title, _mockedDummyView.movieTitle);
        }
예제 #20
0
        public void GetInfoForMovieGetsMovie()
        {
            MockedDummySpecificMovieService _mockedDummyService = new MockedDummySpecificMovieService();
            MockedDummySpecificMovieView    _mockedDummyView    = new MockedDummySpecificMovieView();
            ISpecificMovieInfoPresenter     _presenter          = new SpecificMovieInfoPresenter(_mockedDummyView, _mockedDummyService._specificMovieService);

            _presenter.GetInfoForMovie(1);

            Assert.AreEqual(_mockedDummyService._movie.title, _mockedDummyView.movieTitle);
        }
예제 #21
0
        public void AddCommentInDBThrowsException()
        {
            MockedDummySpecificMovieService _mockedDummyService = new MockedDummySpecificMovieService();
            MockedDummySpecificMovieView    _mockedDummyView    = new MockedDummySpecificMovieView();
            ISpecificMovieInfoPresenter     _presenter          = new SpecificMovieInfoPresenter(_mockedDummyView, _mockedDummyService._specificMovieService);

            _mockedDummyService.error = true;
            _presenter.AddCommentInDB("12345");
            Assert.AreNotEqual(3, _mockedDummyService.comments.Count);
        }
예제 #22
0
        public void DeleteCommentsThrowsException()
        {
            MockedDummySpecificMovieService _mockedDummyService = new MockedDummySpecificMovieService();
            MockedDummySpecificMovieView    _mockedDummyView    = new MockedDummySpecificMovieView();
            ISpecificMovieInfoPresenter     _presenter          = new SpecificMovieInfoPresenter(_mockedDummyView, _mockedDummyService._specificMovieService);

            _mockedDummyService.error = true;
            Assert.Throws <Exception>(() => _presenter.DeleteComments(new List <int>()
            {
                1, 2, 3
            }));
        }
예제 #23
0
        public void DeleteCommentsDeletes()
        {
            MockedDummySpecificMovieService _mockedDummyService = new MockedDummySpecificMovieService();
            MockedDummySpecificMovieView    _mockedDummyView    = new MockedDummySpecificMovieView();
            ISpecificMovieInfoPresenter     _presenter          = new SpecificMovieInfoPresenter(_mockedDummyView, _mockedDummyService._specificMovieService);

            _presenter.DeleteComments(new List <int>()
            {
                1, 2, 3
            });
            Assert.AreEqual(1, _mockedDummyService.comments.Count);
        }