Ejemplo n.º 1
0
        public async Task Edit_WithValidInput_ShouldReturnValidResult()
        {
            var dbContext = ApplicationDbContextCreatorInMemory.InitializeContext();

            await this.SeedData(dbContext);

            var actorsRepository = new EfDeletableEntityRepository <Actor>(dbContext);
            var service          = new ActorsService(actorsRepository);

            var viewModel = new ActorEditModel()
            {
                Id        = 1,
                FirstName = "Edited",
            };

            var result = service.Edit(viewModel);

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