コード例 #1
0
        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>();
            }
        }
コード例 #2
0
        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();
            }
        }