public async Task TestDeleteMeetingInvalidId() { ACMDbContext context = ACMDbContextInMemoryFactory.InitializeContext(); MeetingsService meetingsService = new MeetingsService(context); string id = await CreateAMeeting(context); await Assert.ThrowsAsync <ACMException>(() => meetingsService.DeleteMeeting(id + "Random string")); }
public async Task TestDeleteMeetingGoodData() { ACMDbContext context = ACMDbContextInMemoryFactory.InitializeContext(); MeetingsService meetingsService = new MeetingsService(context); string id = await CreateAMeeting(context); string id2 = await CreateAMeeting(context); bool output = await meetingsService.DeleteMeeting(id); Assert.True(output); Assert.Single(context.Meetings.ToList()); Assert.Equal(3, context.Votes.ToList().Count); Assert.True(context.Meetings.Any(x => x.Id == id2)); }