示例#1
0
        protected async override void OnAppearing()
        {
            base.OnAppearing();
            await model.Init();

            if (model.Movie.Poster.Length == 0)
            {
                this.MovieDetailPoster.Source = ImageSource.FromFile("movieposterplaceholder.png");
            }
        }
示例#2
0
        public void OnInitShouldNotCrashWhenParameterIsNotPassed()
        {
            //Arrange
            Movie destination           = null;
            var   movieDetailsViewModel = new MovieDetailsViewModel();

            //Act
            movieDetailsViewModel.Init(destination);

            //Assert
            Assert.AreEqual(movieDetailsViewModel.Movie, destination);
        }
示例#3
0
        public void OnInitShouldFillMovieParameter()
        {
            //Arrange
            Movie destination           = new Movie();
            var   movieDetailsViewModel = new MovieDetailsViewModel();

            //Act
            movieDetailsViewModel.Init(destination);

            //Assert
            Assert.AreEqual(movieDetailsViewModel.Movie, destination);
        }
示例#4
0
        public void OnInitShouldFillMovieOverviewParameter()
        {
            //Arrange
            Movie destination = new Movie {
                Overview = "Test Overview"
            };
            var movieDetailsViewModel = new MovieDetailsViewModel();

            //Act
            movieDetailsViewModel.Init(destination);

            //Assert
            Assert.AreEqual(movieDetailsViewModel.Movie.Overview, destination.Overview);
        }
示例#5
0
        public void OnInitShouldFillMovieReleaseDateParameter()
        {
            //Arrange
            Movie destination = new Movie {
                ReleaseDate = "2019-12-01"
            };
            var movieDetailsViewModel = new MovieDetailsViewModel();

            //Act
            movieDetailsViewModel.Init(destination);

            //Assert
            Assert.AreEqual(movieDetailsViewModel.Movie.ReleaseDate, destination.ReleaseDate);
        }
示例#6
0
        public void OnInitShouldFillMovieGenresParameter()
        {
            //Arrange
            Movie destination = new Movie {
                GenreNames = "Test genres"
            };
            var movieDetailsViewModel = new MovieDetailsViewModel();

            //Act
            movieDetailsViewModel.Init(destination);

            //Assert
            Assert.AreEqual(movieDetailsViewModel.Movie.GenreNames, destination.GenreNames);
        }
示例#7
0
        public void OnInitShouldFillMovieTitleParameter()
        {
            //Arrange
            Movie destination = new Movie {
                Title = "Test Title"
            };
            var movieDetailsViewModel = new MovieDetailsViewModel();

            //Act
            movieDetailsViewModel.Init(destination);

            //Assert
            Assert.AreEqual(movieDetailsViewModel.Movie.Title, destination.Title);
        }