public async Task ThenShouldGetAccountStats() { // Act var actual = await _orchestrator.GetAccount(HashedAccountId, UserId); //Assert Assert.IsNotNull(actual.Data); Assert.AreEqual(_accountStats.OrganisationCount, actual.Data.OrganisationCount); Assert.AreEqual(_accountStats.PayeSchemeCount, actual.Data.PayeSchemeCount); Assert.AreEqual(_accountStats.TeamMemberCount, actual.Data.TeamMemberCount); }
public async Task ThenAnAgreementShouldNotNeedSigningIfTheUserIsAnOwnerOrTransactorButThereAreNoAgreementsThatNeedSigning() { // Arrange _mediator.Setup(m => m.SendAsync(It.Is <GetAccountEmployerAgreementsRequest>(q => q.HashedAccountId == AccountId))) .ReturnsAsync(new GetAccountEmployerAgreementsResponse { EmployerAgreements = new List <Domain.Models.EmployerAgreement.EmployerAgreementView> { new Domain.Models.EmployerAgreement.EmployerAgreementView { Status = Domain.Models.EmployerAgreement.EmployerAgreementStatus.Signed } } }); // Act var actual = await _orchestrator.GetAccount(AccountId, UserId); // Assert Assert.IsNotNull(actual); Assert.IsFalse(actual.Data.RequiresAgreementSigning); }
public async Task <ActionResult> Index(string hashedAccountId) { var externalUserId = OwinWrapper.GetClaimValue(ControllerConstants.UserRefClaimKeyName); var response = await _employerTeamOrchestrator.GetAccount(hashedAccountId, externalUserId); var flashMessage = GetFlashMessageViewModelFromCookie(); if (flashMessage != null) { response.FlashMessage = flashMessage; response.Data.EmployerAccountType = flashMessage.HiddenFlashMessageInformation; } return(View(response)); }
public async Task <ActionResult> Index(string hashedAccountId) { var userIdClaim = OwinWrapper.GetClaimValue(@"sub"); var response = await _employerTeamOrchestrator.GetAccount(hashedAccountId, userIdClaim); var flashMessage = GetFlashMessageViewModelFromCookie(); if (flashMessage != null) { response.FlashMessage = flashMessage; response.Data.EmployerAccountType = flashMessage.HiddenFlashMessageInformation; } return(View(response)); }