Exemplo n.º 1
0
        public async Task EditAsync_WithNullInput_ShouldThrowException()
        {
            var context = WilderExperienceContextInMemoryFactory.InitializeContext();

            var repository = new EfDeletableEntityRepository <Experience>(context);
            var service    = new ExperiencesService(repository);

            Task act() => service.EditAsync(null);

            await Assert.ThrowsAsync <ArgumentNullException>(act);
        }
Exemplo n.º 2
0
        public async Task EditAsync_ShouldThrowException()
        {
            var context = WilderExperienceContextInMemoryFactory.InitializeContext();

            await this.SeedData(context);

            var expectedTitle = "New Title";

            var input = new ExperienceEditViewModel()
            {
                Id          = 3,
                Title       = expectedTitle,
                Description = "Description of test",
            };

            var repository = new EfDeletableEntityRepository <Experience>(context);
            var service    = new ExperiencesService(repository);

            Task act() => service.EditAsync(input);

            await Assert.ThrowsAsync <ArgumentNullException>(act);
        }