コード例 #1
0
        public async Task MemberListingWorks()
        {
            await firstContext.CreateUser(firstAuth);

            var groupId = await firstGroups.UpsertGroup(DefaultGroup());

            var details = await firstGroups.Details(groupId);

            Assert.Single(details.Members);
            Assert.Equal(firstContext.UserId, details.Members[0].Id);
            Assert.False(details.Members[0].Invited);
        }
コード例 #2
0
        public async Task MemberListingIsNotAllowedWhenUserIsNotInGroup()
        {
            await firstContext.CreateUser(firstAuth);

            await secondContext.CreateUser(secondAuth, "SecondFellow");

            var groupId = await firstGroups.UpsertGroup(DefaultGroup());

            var exception = await Assert.ThrowsAsync <DatesException>(async() =>
            {
                await secondGroups.Details(groupId);
            });

            Assert.Equal("You do not belong to this group", exception.Message);
        }
コード例 #3
0
 public Task <GroupDetails> Details(int id)
 {
     return(groupsService.Details(id));
 }