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); }
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); }
public Task <GroupDetails> Details(int id) { return(groupsService.Details(id)); }