Skip to content

Commit

Permalink
add unit tests to SiriusLpaFactoryTest
Browse files Browse the repository at this point in the history
  • Loading branch information
MishNajam committed Nov 15, 2023
1 parent 0149fd0 commit 30d1bef
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,48 @@ public function can_create_lpa_from_simple_example(): void
$this->assertEquals([0], $lpa->getDonor()->getIds());
}

/**
* @test
*/
public function can_hydrate_donor_from_simple_example(): void
{
$factory = new Sirius();

$lpa = $factory->createLpaFromData($this->simpleExampleFixtureData);
$donor = $lpa->getDonor();

$this->assertEquals(0, $donor->getId());
$this->assertEquals('7000-0000-0054', $donor->getUId());
$this->assertEquals('string', $donor->getEmail());
$this->assertEquals('Mrs', $donor->getSalutation());
$this->assertEquals('Ian', $donor->getFirstname());
$this->assertEquals(null, $donor->getOtherNames());
$this->assertEquals(null, $donor->getMiddlenames());
$this->assertEquals('Deputy', $donor->getSurname());
$this->assertEquals('ABC Ltd', $donor->getCompanyName());
}

/**
* @test
*/
public function can_hydrate_attorney_from_simple_example(): void
{
$factory = new Sirius();

$lpa = $factory->createLpaFromData($this->simpleExampleFixtureData);
$attorney = $lpa->getAttorneys()[0];

$this->assertEquals(0, $attorney->getId());
$this->assertEquals('7000-0000-0054', $attorney->getUId());
$this->assertEquals('string', $attorney->getEmail());
$this->assertEquals('Mrs', $attorney->getSalutation());
$this->assertEquals('Ian', $attorney->getFirstname());
$this->assertEquals('George', $attorney->getOtherNames());
$this->assertEquals('Deputy', $attorney->getMiddlenames());
$this->assertEquals('Deputy', $attorney->getSurname());
$this->assertEquals('ABC Ltd', $attorney->getCompanyName());
}

/**
* @test
*/
Expand Down
7 changes: 7 additions & 0 deletions service-front/app/test/fixtures/full_example.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"dob": "1980-10-10",
"salutation": "Mrs",
"firstname": "Ian",
"otherNames": "George",
"middlenames": "Deputy",
"surname": "Deputy",
"companyName": "ABC Ltd",
Expand All @@ -52,6 +53,7 @@
"dob": "1975-10-05",
"salutation": "Mrs",
"firstname": "Ian",
"otherNames": "George",
"middlenames": "Deputy",
"surname": "Deputy",
"companyName": "ABC Ltd",
Expand All @@ -77,6 +79,7 @@
"email": "string",
"salutation": "Mr",
"firstname": "Simon",
"otherNames": null,
"middlenames": null,
"surname": "Matthews",
"companyName": null,
Expand All @@ -102,6 +105,7 @@
"email": "string",
"salutation": "Mr",
"firstname": "Harold",
"otherNames": null,
"middlenames": null,
"surname": "Stallman",
"companyName": null,
Expand Down Expand Up @@ -129,6 +133,7 @@
"dob": "1980-10-10",
"salutation": "Mrs",
"firstname": "Ian",
"otherNames": "George",
"middlenames": "Deputy",
"surname": "Deputy",
"companyName": "ABC Ltd",
Expand All @@ -155,6 +160,7 @@
"dob": "1980-10-10",
"salutation": "Mrs",
"firstname": "Ian",
"otherNames": "George",
"middlenames": "Deputy",
"surname": "Deputy",
"companyName": "ABC Ltd",
Expand All @@ -181,6 +187,7 @@
"dob": "1980-10-10",
"salutation": "Mrs",
"firstname": "Ian",
"otherNames": "George",
"middlenames": "Deputy",
"surname": "Deputy",
"companyName": "ABC Ltd",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"dob": "1980-10-10",
"salutation": "Mrs",
"firstname": "Ian",
"otherNames": "George",
"middlenames": "Deputy",
"surname": "Deputy",
"companyName": "ABC Ltd",
Expand All @@ -51,6 +52,7 @@
"dob": "1975-10-05",
"salutation": "Mrs",
"firstname": "Ian",
"otherNames": "George",
"middlenames": "Deputy",
"surname": "Deputy",
"companyName": "ABC Ltd",
Expand All @@ -76,6 +78,7 @@
"email": "string",
"salutation": "Mr",
"firstname": "Simon",
"otherNames": null,
"middlenames": null,
"surname": "Matthews",
"companyName": null,
Expand All @@ -101,6 +104,7 @@
"email": "string",
"salutation": "Mr",
"firstname": "Harold",
"otherNames": null,
"middlenames": null,
"surname": "Stallman",
"companyName": null,
Expand Down Expand Up @@ -128,6 +132,7 @@
"dob": "1980-10-10",
"salutation": "Mrs",
"firstname": "Ian",
"otherNames": "George",
"middlenames": "Deputy",
"surname": "Deputy",
"companyName": "ABC Ltd",
Expand All @@ -154,6 +159,7 @@
"dob": "1980-10-10",
"salutation": "Mrs",
"firstname": "Ian",
"otherNames": "George",
"middlenames": "Deputy",
"surname": "Deputy",
"companyName": "ABC Ltd",
Expand All @@ -180,6 +186,7 @@
"dob": "1980-10-10",
"salutation": "Mrs",
"firstname": "Ian",
"otherNames": "George",
"middlenames": "Deputy",
"surname": "Deputy",
"companyName": "ABC Ltd",
Expand Down
2 changes: 2 additions & 0 deletions service-front/app/test/fixtures/simple_example.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"dob": "1980-10-10",
"salutation": "Mrs",
"firstname": "Ian",
"otherNames": null,
"middlenames": null,
"surname": "Deputy",
"companyName": "ABC Ltd",
Expand All @@ -51,6 +52,7 @@
"dob": "1980-10-10",
"salutation": "Mrs",
"firstname": "Ian",
"otherNames": "George",
"middlenames": "Deputy",
"surname": "Deputy",
"companyName": "ABC Ltd",
Expand Down

0 comments on commit 30d1bef

Please sign in to comment.