示例#1
0
        public async Task TestEditMeetingInvalidId()
        {
            ACMDbContext    context         = ACMDbContextInMemoryFactory.InitializeContext();
            MeetingsService meetingsService = new MeetingsService(context);
            string          id = await CreateAMeeting(context);

            await Assert.ThrowsAsync <ACMException>(() => meetingsService
                                                    .EditMeeting(id + "Random string", "new text", new List <VoteDTO>()));
        }
示例#2
0
        public async Task TestEditMeetingGoodData()
        {
            ACMDbContext    context         = ACMDbContextInMemoryFactory.InitializeContext();
            MeetingsService meetingsService = new MeetingsService(context);
            string          id = await CreateAMeeting(context);

            bool output = await meetingsService.EditMeeting(id, "new text", new List <VoteDTO>());

            Assert.True(output);
            Assert.Equal("new text", context.Meetings.Where(x => x.Id == id).FirstOrDefault().Text);
            Assert.Empty(context.Votes.ToList());
        }