public async Task ShouldNotFindUser() { await using (var context = new DbContextFactory().CreateContext()) { var service = new EventServiceFactory().Create(context); FluentActions.Invoking(async() => await service.Cancel(Guid.NewGuid())) .Should().Throw <EventNotFoundException>(); } }
public async Task ShouldCancelEvent() { await using (var context = new DbContextFactory().CreateContext()) { var service = new EventServiceFactory().Create(context); await service.Cancel(RealEventId); var result = await context.Events.FirstOrDefaultAsync(x => x.Id == RealEventId); result.isCanceled.Should().BeTrue(); } }