public async Task ThenOnlyOwnersShouldBeAbleToGetATeamMembersDetails(Role userRole, HttpStatusCode status) { //Arrange _mediator.Setup(x => x.SendAsync(It.IsAny <GetUserAccountRoleQuery>())) .ReturnsAsync(new GetUserAccountRoleResponse { UserRole = userRole }); //Act var result = await _orchestrator.GetTeamMember(HashedAccountId, TeamMemberEmail, ExternalUserId); //Assert _mediator.Verify(x => x.SendAsync(It.Is <GetUserAccountRoleQuery>(q => q.HashedAccountId.Equals(HashedAccountId) && q.ExternalUserId.Equals(ExternalUserId))), Times.Once); Assert.AreEqual(status, result.Status); }
public async Task <ActionResult> ChangeRole(string hashedAccountId, string email) { var teamMember = await _employerTeamOrchestrator.GetTeamMember(hashedAccountId, email, OwinWrapper.GetClaimValue(@"sub")); return(View(teamMember)); }