コード例 #1
0
        public async System.Threading.Tasks.Task GetMembers_ManageTeamsMembersServiceReturnTeamMember_ReturnTeamMember()
        {
            //Arrange
            const int    teamId   = 4;
            const string memberId = "def-abc";

            var mock = GetFakeDbTeamMembers().AsQueryable().BuildMock();

            _teamMemberRepository.Setup(x => x.GetAll()).Returns(mock.Object);

            //Act
            var result = await _manageTeamsMembersService.GetMemberAsync(teamId, memberId);

            //Assert
            Assert.AreEqual(result.TeamId, teamId);
            Assert.AreEqual(result.MemberId, memberId);
        }
コード例 #2
0
 public async Task <TeamMember> GetMemberAsync(int teamId, string memberId)
 {
     if (await _accessCheckService.OwnerOrMemberAsync(teamId))
     {
         return(await _manageTeamsMembersService.GetMemberAsync(teamId, memberId));
     }
     else
     {
         return(null);
     }
 }