public async Task ThenTheMediatorIsCalledToGetThePayeSchemeWhenASchemeIsSelectedToBeRemoved() { //Arrange _mediator.Setup(x => x.SendAsync(It.IsAny <GetEmployerAccountHashedQuery>())) .ReturnsAsync(new GetEmployerAccountResponse { Account = new Account { Name = "test account" } }); //Act await _employerAccountPayeOrchestrator.GetRemovePayeSchemeModel(new RemovePayeSchemeViewModel()); //Assert _mediator.Verify(x => x.SendAsync(It.IsAny <GetPayeSchemeByRefQuery>()), Times.Once); }
public async Task <ActionResult> Remove(string hashedAccountId, string empRef) { var model = await _employerAccountPayeOrchestrator.GetRemovePayeSchemeModel(new RemovePayeSchemeViewModel { HashedAccountId = hashedAccountId, PayeRef = empRef.FormatPayeFromUrl(), UserId = OwinWrapper.GetClaimValue("sub") }); return(View(model)); }