Example #1
0
        public async Task Edit_WithValidInput_ShouldReturnValidResult()
        {
            var dbContext = ApplicationDbContextCreatorInMemory.InitializeContext();

            await this.SeedData(dbContext);

            var moviesRepository = new EfDeletableEntityRepository <Movie>(dbContext);
            var genresRepository = new EfDeletableEntityRepository <Genre>(dbContext);
            var service          = new MoviesService(moviesRepository, genresRepository);

            var viewModel = new MovieEditModel()
            {
                Title = "Edited",
            };

            var result = service.Edit(viewModel);

            Assert.Equal("Edited", viewModel.Title);
        }