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

            await this.SeedData(dbContext);

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

            var actor = service.GetById <ActorEditModel>(1);

            var result = service.Delete(actor);

            Assert.Equal(1, dbContext.Actors.Count());
        }