@@ -51,6 +51,22 @@ public async Task SaveDraftIcraEligibility_AndGetById()
5151 savedEligibility . Id . ShouldNotBeNull ( ) ;
5252 savedEligibility . Status . ShouldBe ( ICRAStatus . Draft ) ;
5353
54+ savedEligibility . EmploymentReferences = new [ ]
55+ {
56+ new EmploymentReference { Id = null , FirstName = "John" , LastName = "Doe" , EmailAddress = "[email protected] " , PhoneNumber = "" } , 57+ new EmploymentReference { Id = null , FirstName = "Jane" , LastName = "Smith" , EmailAddress = "[email protected] " , PhoneNumber = "1234567890" } 58+ } ;
59+
60+ var saveWithRefsResponse = await Host . Scenario ( _ =>
61+ {
62+ _ . WithExistingUser ( this . Fixture . AuthenticatedBcscUserIdentity , this . Fixture . AuthenticatedBcscUser ) ;
63+ _ . Put . Json ( new SaveDraftICRAEligibilityRequest ( savedEligibility ) ) . ToUrl ( $ "/api/icra/{ savedEligibility . Id } ") ;
64+ _ . StatusCodeShouldBeOk ( ) ;
65+ } ) ;
66+ var savedWithRefs = ( await saveWithRefsResponse . ReadAsJsonAsync < DraftICRAEligibilityResponse > ( ) ) . ShouldNotBeNull ( ) . Eligibility ;
67+ savedWithRefs . EmploymentReferences . ShouldNotBeNull ( ) ;
68+ savedWithRefs . EmploymentReferences . Count ( ) . ShouldBe ( 2 ) ;
69+
5470 var getResponse = await Host . Scenario ( _ =>
5571 {
5672 _ . WithExistingUser ( this . Fixture . AuthenticatedBcscUserIdentity , this . Fixture . AuthenticatedBcscUser ) ;
@@ -61,6 +77,7 @@ public async Task SaveDraftIcraEligibility_AndGetById()
6177 var eligibilities = await getResponse . ReadAsJsonAsync < IEnumerable < ICRAEligibility > > ( ) ;
6278 eligibilities . ShouldNotBeNull ( ) ;
6379 eligibilities . ShouldContain ( e => e . Id == savedEligibility . Id ) ;
80+ eligibilities . First ( e => e . Id == savedEligibility . Id ) . EmploymentReferences . Count ( ) . ShouldBe ( 2 ) ;
6481 }
6582
6683 [ Fact ]
@@ -143,7 +160,7 @@ public async Task SaveDraftIcraEligibility_WithInternationalCertificationAndFile
143160 CertificateTitle = faker . Company . CatchPhrase ( ) ,
144161 IssueDate = faker . Date . Past ( ) ,
145162 ExpiryDate = faker . Date . Soon ( ) ,
146- CountryId = countryId ,
163+ CountryId = countryId ,
147164 NewFiles = new [ ] { uploadedFileResponse . fileId }
148165 }
149166 }
0 commit comments