Skip to content

Commit

Permalink
5011: Updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Rool committed Dec 2, 2022
1 parent 73db6bf commit ea19314
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,44 @@ class EventDetailsGeneratorTest: XCTestCase {
expect(details[11].value) == "1234"
}

func testVaccinationDetailsGenerator_withHPKCode() {

// Given
let identity = EventFlow.Identity.fakeIdentity
let event = EventFlow.Event.vaccinationEventWithHPKCode
environmentSpies.mappingManagerSpy.stubbedGetVaccinationBrandResult = "Pfizer (Comirnaty)"
environmentSpies.mappingManagerSpy.stubbedGetVaccinationTypeResult = "SARS-CoV-2 mRNA vaccine"
environmentSpies.mappingManagerSpy.stubbedGetVaccinationManufacturerResult = "Biontech"
environmentSpies.mappingManagerSpy.stubbedGetDisplayCountryResult = "NL"
environmentSpies.mappingManagerSpy.stubbedGetHpkDataResult = HPKData(
code: "1234",
name: "Test",
displayName: "Vaccination Product Name",
vaccineOrProphylaxis: "vp",
medicalProduct: "mp",
marketingAuthorizationHolder: "ma"
)

// When
let details = VaccinationDetailsGenerator.getDetails(identity: identity, event: event, providerIdentifier: "CC")

// Then
expect(details).to(haveCount(13))
expect(details[0].value) == nil
expect(details[1].value) == "Check, Corona"
expect(details[2].value) == "16 mei 1980"
expect(details[3].value) == L.holderEventAboutVaccinationPathogenvalue()
expect(details[4].value) == "Pfizer (Comirnaty)"
expect(details[5].value) == "Vaccination Product Name"
expect(details[6].value) == "SARS-CoV-2 mRNA vaccine"
expect(details[7].value) == "Biontech"
expect(details[8].value) == "1 van 2"
expect(details[9].value) == nil
expect(details[10].value) == "16 mei 2021"
expect(details[11].value) == "NL"
expect(details[12].value) == "1234"
}

func testVaccinationAssessmentDetailsGenerator() {

// Given
Expand Down
26 changes: 26 additions & 0 deletions CTRTests/Utils/Fakes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,32 @@ extension EventFlow.Event {
)
}

static var vaccinationEventWithHPKCode: EventFlow.Event {
EventFlow.Event(
type: "vaccination",
unique: "1234",
isSpecimen: true,
vaccination: EventFlow.VaccinationEvent(
dateString: "2021-05-16",
hpkCode: "1234",
type: nil,
manufacturer: "ORG-100030215",
brand: "EU/1/20/1528",
doseNumber: 1,
totalDoses: 2,
country: "NLD",
completedByMedicalStatement: nil,
completedByPersonalStatement: nil,
completionReason: nil
),
negativeTest: nil,
positiveTest: nil,
recovery: nil,
dccEvent: nil,
vaccinationAssessment: nil
)
}

static var boosterEvent: EventFlow.Event {
EventFlow.Event(
type: "vaccination",
Expand Down

0 comments on commit ea19314

Please sign in to comment.