예제 #1
0
        public void SetMovieTitelInViewReturns()
        {
            MockedDummyProfileScreenService _mockedDummy    = new MockedDummyProfileScreenService();
            IProfileScreen          _profileScreen          = new ProfileScreenViewDummy();
            IProfileScreenPresenter _profileScreenPresenter = new ProfileScreenPresenter(_profileScreen, _mockedDummy._profileScreenService);

            Assert.AreEqual("Terminator", _profileScreenPresenter.SetMovieTitelInView(1));
        }
예제 #2
0
        public void ChangeProfilePictureChanges()
        {
            MockedDummyProfileScreenService _mockedDummy    = new MockedDummyProfileScreenService();
            IProfileScreen          _profileScreen          = new ProfileScreenViewDummy();
            IProfileScreenPresenter _profileScreenPresenter = new ProfileScreenPresenter(_profileScreen, _mockedDummy._profileScreenService);

            _profileScreenPresenter.ChangeProfilePicture(new byte[50]);

            Assert.AreEqual(_mockedDummy._userInfo.picture.Count(), _profileScreen.Picture.Count());
        }
예제 #3
0
        public void UpdateWatchListWhenMovieAddedUpdates()
        {
            MockedDummyProfileScreenService _mockedDummy    = new MockedDummyProfileScreenService();
            IProfileScreen          _profileScreen          = new ProfileScreenViewDummy();
            IProfileScreenPresenter _profileScreenPresenter = new ProfileScreenPresenter(_profileScreen, _mockedDummy._profileScreenService);

            _profileScreenPresenter.UpdateWatchListWhenMovieAdded(1);

            Assert.AreEqual(_mockedDummy.watchlist, _profileScreen.watchList);
        }
예제 #4
0
        public void DeleteMovieFromwatchListCatchesException()
        {
            MockedDummyProfileScreenService _mockedDummy    = new MockedDummyProfileScreenService();
            IProfileScreen          _profileScreen          = new ProfileScreenViewDummy();
            IProfileScreenPresenter _profileScreenPresenter = new ProfileScreenPresenter(_profileScreen, _mockedDummy._profileScreenService);

            _mockedDummy.error = true;
            _profileScreenPresenter.SetUserInformation(1);
            _profileScreenPresenter.DeleteMovieFromwatchList(1);
            Assert.AreNotEqual(2, _profileScreen.watchList.Count());
        }
예제 #5
0
        public void ChangeProfilePictureCatchesException()
        {
            MockedDummyProfileScreenService _mockedDummy    = new MockedDummyProfileScreenService();
            IProfileScreen          _profileScreen          = new ProfileScreenViewDummy();
            IProfileScreenPresenter _profileScreenPresenter = new ProfileScreenPresenter(_profileScreen, _mockedDummy._profileScreenService);

            _profileScreenPresenter.SetUserInformation(1);
            _profileScreenPresenter.SetUserInformation(1);
            _mockedDummy.error = true;
            _profileScreenPresenter.ChangeProfilePicture(new byte[50]);
            Assert.AreNotEqual(50, _profileScreen.Picture.Count());
        }
예제 #6
0
        public void SetUserInformationSetsInfo()
        {
            MockedDummyProfileScreenService _mockedDummy    = new MockedDummyProfileScreenService();
            IProfileScreen          _profileScreen          = new ProfileScreenViewDummy();
            IProfileScreenPresenter _profileScreenPresenter = new ProfileScreenPresenter(_profileScreen, _mockedDummy._profileScreenService);

            _profileScreenPresenter.SetUserInformation(1);

            Assert.AreEqual("MasterPesho", _profileScreen.UserName);
            Assert.AreEqual("Peter", _profileScreen.FirstName);
            Assert.AreEqual("Peter", _profileScreen.LastName);
            Assert.AreEqual(15, _profileScreen.Age);
            Assert.AreEqual("M", _profileScreen.Gender);
            Assert.AreEqual("*****@*****.**", _profileScreen.Email);
            Assert.AreEqual(_profileScreen.Picture.Count(), _mockedDummy._userInfo.picture.Count());
        }