public EmployerIncentivesApiBuilder WithAccountWithSingleLegalEntityWithNoEligibleApprenticeships() { var data = new TestData.Account.WithSingleLegalEntityWithNoEligibleApprenticeships(); _server .Given( Request .Create() .WithPath($"/accounts/{data.AccountId}/legalentities") .UsingGet() ) .RespondWith( Response.Create() .WithStatusCode(HttpStatusCode.OK) .WithBody(JsonConvert.SerializeObject(new List <LegalEntityDto>() { data.LegalEntity }, TestHelper.DefaultSerialiserSettings))); _server .Given( Request .Create() .WithPath($"/accounts/{data.AccountId}/legalentities/{data.AccountLegalEntityId}") .UsingGet() ) .RespondWith( Response.Create() .WithStatusCode(HttpStatusCode.OK) .WithBody(JsonConvert.SerializeObject(data.LegalEntity, TestHelper.DefaultSerialiserSettings))); _server .Given( Request .Create() .WithPath($"/apprenticeships") .WithParam("accountid", data.AccountId.ToString()) .WithParam("accountlegalentityid", data.LegalEntity.AccountLegalEntityId.ToString()) .UsingGet() ) .RespondWith( Response.Create() .WithStatusCode(HttpStatusCode.NotFound)); AddClaim(EmployerClaimTypes.Account, data.HashedAccountId); return(this); }
public void GivenAnEmployerApplyingHasASingleLegalEntityWithNoEligibleApprenticeships() { var testdata = new TestData.Account.WithSingleLegalEntityWithNoEligibleApprenticeships(); _testDataStore.Add("HashedAccountId", testdata.HashedAccountId); _testContext.AddOrReplaceClaim(EmployerClaimTypes.Account, testdata.HashedAccountId); _testDataStore.Add("HashedAccountLegalEntityId", testdata.HashedAccountLegalEntityId); _testDataStore.Add("LegalEntity", testdata.LegalEntity); _testContext.EmployerIncentivesApi.MockServer .Given( Request .Create() .WithPath($"/accounts/{testdata.AccountId}/legalentities") .UsingGet() ) .RespondWith( Response.Create() .WithStatusCode(HttpStatusCode.OK) .WithBody(JsonConvert.SerializeObject(testdata.LegalEntities, TestHelper.DefaultSerialiserSettings))); _testContext.EmployerIncentivesApi.MockServer .Given( Request .Create() .WithPath($"/accounts/{testdata.AccountId}/legalentities/{testdata.AccountLegalEntityId}") .UsingGet() ) .RespondWith( Response.Create() .WithStatusCode(HttpStatusCode.OK) .WithBody(JsonConvert.SerializeObject(testdata.LegalEntities.First(), TestHelper.DefaultSerialiserSettings))); _testContext.EmployerIncentivesApi.MockServer .Given( Request .Create() .WithPath($"/apprenticeships") .WithParam("accountid", testdata.AccountId.ToString()) .WithParam("accountlegalentityid", testdata.LegalEntities.First().AccountLegalEntityId.ToString()) .UsingGet() ) .RespondWith( Response.Create() .WithStatusCode(HttpStatusCode.NotFound)); }