protected async override void OnAppearing() { base.OnAppearing(); await model.Init(); if (model.Movie.Poster.Length == 0) { this.MovieDetailPoster.Source = ImageSource.FromFile("movieposterplaceholder.png"); } }
public void OnInitShouldNotCrashWhenParameterIsNotPassed() { //Arrange Movie destination = null; var movieDetailsViewModel = new MovieDetailsViewModel(); //Act movieDetailsViewModel.Init(destination); //Assert Assert.AreEqual(movieDetailsViewModel.Movie, destination); }
public void OnInitShouldFillMovieParameter() { //Arrange Movie destination = new Movie(); var movieDetailsViewModel = new MovieDetailsViewModel(); //Act movieDetailsViewModel.Init(destination); //Assert Assert.AreEqual(movieDetailsViewModel.Movie, destination); }
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); }
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); }
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); }
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); }