public ActionResult Get() { GetAccountProviderLegalEntityRouteValues = new GetAccountProviderLegalEntityRouteValues { AccountId = 1, AccountProviderId = 2, AccountLegalEntityId = 3 }; GetAccountProviderLegalEntityQueryResult = new GetAccountProviderLegalEntityQueryResult( new Application.Queries.GetAccountProviderLegalEntity.Dtos.AccountProviderDto(), new Application.Queries.GetAccountProviderLegalEntity.Dtos.AccountLegalEntityDto(), new Application.Queries.GetAccountProviderLegalEntity.Dtos.AccountProviderLegalEntityDto { Operations = new List <Operation> { Operation.CreateCohort } }, 2, false); Mediator.Setup(m => m.Send(It.Is <GetAccountProviderLegalEntityQuery>(q => q.AccountId == GetAccountProviderLegalEntityRouteValues.AccountId && q.AccountProviderId == GetAccountProviderLegalEntityRouteValues.AccountProviderId && q.AccountLegalEntityId == GetAccountProviderLegalEntityRouteValues.AccountLegalEntityId), CancellationToken.None)) .ReturnsAsync(GetAccountProviderLegalEntityQueryResult); return(AccountProviderLegalEntitiesController.Get(GetAccountProviderLegalEntityRouteValues)); }
public Task <ActionResult> Set(Operation operation) { OperationRouteValue = new OperationRouteValue { AccountId = 1, AccountProviderId = 2, AccountLegalEntityId = 3, OperationId = (short)operation }; GetAccountProviderLegalEntityQueryResult = new GetAccountProviderLegalEntityQueryResult( new Application.Queries.GetAccountProviderLegalEntity.Dtos.AccountProviderDto(), new Application.Queries.GetAccountProviderLegalEntity.Dtos.AccountLegalEntityDto(), new Application.Queries.GetAccountProviderLegalEntity.Dtos.AccountProviderLegalEntityDto(), 0, false); Mediator.Setup(m => m.Send( It.Is <GetAccountProviderLegalEntityQuery>(q => q.AccountId == OperationRouteValue.AccountId && q.AccountProviderId == OperationRouteValue.AccountProviderId && q.AccountLegalEntityId == OperationRouteValue.AccountLegalEntityId), CancellationToken.None)) .ReturnsAsync(GetAccountProviderLegalEntityQueryResult); return(OperationsController.Set(OperationRouteValue)); }