/// <summary> /// Map Galaxy movie session model to app movie session model /// </summary> /// <param name="galaxyMovieSession">Galaxy movie session model separated by date</param> /// <param name="movieId">>Galaxy movie id</param> /// <returns>App Movie session model</returns> public static MovieSession MapToMovieSession(GalaxyMovieSessionItem galaxyMovieSession, string movieId) { return(new MovieSession { MovieId = movieId, Location = galaxyMovieSession.Address, ShowDate = galaxyMovieSession.ShowDate, ShowTime = galaxyMovieSession.ShowTime }); }
public void Test_MapToMovieSessionFromGalaxyMovieSession() { // arrange var movieId = "fad62b29-a4ae-4e37-bb3e-b43e1236d488"; var galaxyMovieSession = new GalaxyMovieSessionItem { Address = "Galaxy cinema address", ShowDate = "20191129", ShowTime = "2015" }; // action var movieSession = Mapper.MapToMovieSession(galaxyMovieSession, movieId); // assert Assert.AreEqual("fad62b29-a4ae-4e37-bb3e-b43e1236d488", movieSession.MovieId); Assert.AreEqual("Galaxy cinema address", movieSession.Location); Assert.AreEqual("20191129", movieSession.ShowDate); Assert.AreEqual("2015", movieSession.ShowTime); }