示例#1
0
        public SelectEmployerViewModelMapperFixture()
        {
            _providerId = 123;
            _request    = new SelectEmployerRequest {
                ProviderId = _providerId
            };
            _apiResponse = new GetAccountProviderLegalEntitiesWithPermissionResponse
            {
                AccountProviderLegalEntities = new List <AccountProviderLegalEntityDto>
                {
                    new AccountProviderLegalEntityDto
                    {
                        AccountId = 123,
                        AccountLegalEntityPublicHashedId = "DSFF23",
                        AccountLegalEntityName           = "TestAccountLegalEntityName",
                        AccountPublicHashedId            = "DFKFK66",
                        AccountName          = "TestAccountName",
                        AccountLegalEntityId = 456,
                        AccountProviderId    = 234
                    }
                }
            };

            _providerRelationshipsApiClientMock = new Mock <IProviderRelationshipsApiClient>();
            _providerRelationshipsApiClientMock
            .Setup(x => x.GetAccountProviderLegalEntitiesWithPermission(
                       It.IsAny <GetAccountProviderLegalEntitiesWithPermissionRequest>(),
                       CancellationToken.None))
            .ReturnsAsync(() => _apiResponse);

            _sut = new SelectEmployerViewModelMapper(_providerRelationshipsApiClientMock.Object);
        }
示例#2
0
        public SelectEmployerViewModelMapperFixture()
        {
            _providerId           = 123;
            _accountLegalEntityId = 457;
            _apprenticeshipId     = 1;
            _request = new SelectEmployerRequest {
                ProviderId = _providerId, ApprenticeshipId = _apprenticeshipId
            };
            _apiResponse = new GetAccountProviderLegalEntitiesWithPermissionResponse
            {
                AccountProviderLegalEntities = new List <AccountProviderLegalEntityDto>
                {
                    new AccountProviderLegalEntityDto
                    {
                        AccountId = 123,
                        AccountLegalEntityPublicHashedId = "DSFF23",
                        AccountLegalEntityName           = "TestAccountLegalEntityName",
                        AccountPublicHashedId            = "DFKFK66",
                        AccountName          = "TestAccountName",
                        AccountLegalEntityId = 456,
                        AccountProviderId    = 234
                    },
                    new AccountProviderLegalEntityDto
                    {
                        AccountId = 124,
                        AccountLegalEntityPublicHashedId = "DSFF24",
                        AccountLegalEntityName           = "TestAccountLegalEntityName2",
                        AccountPublicHashedId            = "DFKFK67",
                        AccountName          = "TestAccountNam2",
                        AccountLegalEntityId = _accountLegalEntityId,
                        AccountProviderId    = 235
                    }
                }
            };

            GetApprenticeshipApiResponse = new CommitmentsV2.Api.Types.Responses.GetApprenticeshipResponse
            {
                AccountLegalEntityId = _accountLegalEntityId,
                EmployerName         = "TestName"
            };

            _providerRelationshipsApiClientMock = new Mock <IProviderRelationshipsApiClient>();
            _providerRelationshipsApiClientMock
            .Setup(x => x.GetAccountProviderLegalEntitiesWithPermission(
                       It.IsAny <GetAccountProviderLegalEntitiesWithPermissionRequest>(),
                       CancellationToken.None))
            .ReturnsAsync(_apiResponse);

            _commitmentApiClientMock = new Mock <ICommitmentsApiClient>();

            _commitmentApiClientMock.Setup(x => x.GetApprenticeship(_apprenticeshipId, It.IsAny <CancellationToken>()))
            .ReturnsAsync(GetApprenticeshipApiResponse);

            _sut = new SelectEmployerViewModelMapper(_providerRelationshipsApiClientMock.Object, _commitmentApiClientMock.Object);
        }