public void UserAlreadyRatedReturnsTrues()
        {
            MockedDummySpecificMovieService _mockedDummyService = new MockedDummySpecificMovieService();
            MockedDummySpecificMovieView    _mockedDummyView    = new MockedDummySpecificMovieView();
            ISpecificMovieInfoPresenter     _presenter          = new SpecificMovieInfoPresenter(_mockedDummyView, _mockedDummyService._specificMovieService);

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

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

            Assert.AreEqual(true, _presenter.UserHasMovieInWatchList());
        }
        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());
        }
        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);
        }
        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);
        }
        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());
        }
        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);
        }
        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);
        }
        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);
        }
        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);
        }
        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());
        }
        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);
        }
        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);
        }
        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);
        }
        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);
        }
        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);
        }
        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);
        }
        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);
        }
        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);
        }
        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);
        }
        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
            }));
        }
        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);
        }