-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. Updated HealthInformation class and corresponding testings
2. Changes the 3 fields of HealthInformation from public to private, as well as all other codes that is affected by this changed. Added more tests in JavaClassConfirmationTests for the HealthInformation class and also changes some of the tests to fit the new version of HealthInformation 3. All tests pass and no error occurred
- Loading branch information
1 parent
4b32163
commit 5b396bb
Showing
5 changed files
with
38 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,14 +33,14 @@ public void testPatientEmptyConstructor(){ | |
@Test | ||
public void testHealthInformationEmptyConstructor(){ | ||
HealthInformation healthInformation = new HealthInformation(); | ||
assertEquals(healthInformation.gender, null); | ||
assertEquals(healthInformation.getGender(), null); | ||
} | ||
|
||
@Test | ||
public void testPatientGetInfo(){ | ||
// when(patView.navigateToPatientSignup()).getMock(); | ||
Patient pat = new Patient("Patient1"); | ||
HealthInformation healthInformation = new HealthInformation(10,100,"Female"); | ||
HealthInformation healthInformation = new HealthInformation(new Date(100, 1 , 1),100,"Female"); | ||
pat.setHealthInformation(healthInformation); | ||
|
||
// ArgumentCaptor<String> captor = ArgumentCaptor.forClass(String.class); | ||
|
@@ -52,31 +52,31 @@ public void testPatientGetInfo(){ | |
|
||
@Test | ||
public void testPatientToString(){ | ||
HealthInformation healthInformation = new HealthInformation(10,100,"Female"); | ||
HealthInformation healthInformation = new HealthInformation(new Date(100, 1 , 1),100,"Female"); | ||
Patient pat = new Patient("Patient1", "[email protected]", "password1", healthInformation); | ||
|
||
assertEquals(pat.toString(), "{Patient name: Patient1}"); | ||
} | ||
|
||
@Test | ||
public void testPersonSetGetName(){ | ||
HealthInformation healthInformation = new HealthInformation(10,100,"Female"); | ||
HealthInformation healthInformation = new HealthInformation(new Date(100, 1 , 1),100,"Female"); | ||
Patient pat = new Patient("P1", "[email protected]", "password1", healthInformation); | ||
pat.setName("Kevin"); | ||
assertEquals(pat.getName(), "Kevin"); | ||
} | ||
|
||
@Test | ||
public void testPersonSetGetEmail(){ | ||
HealthInformation healthInformation = new HealthInformation(10,100,"Female"); | ||
HealthInformation healthInformation = new HealthInformation(new Date(100, 1 , 1),100,"Female"); | ||
Patient pat = new Patient("P1", "[email protected]", "password1", healthInformation); | ||
pat.setEmail("[email protected]"); | ||
assertEquals(pat.getEmail(), "[email protected]"); | ||
} | ||
|
||
@Test | ||
public void testPersonSetGetPassword(){ | ||
HealthInformation healthInformation = new HealthInformation(10,100,"Female"); | ||
HealthInformation healthInformation = new HealthInformation(new Date(100, 1 , 1),100,"Female"); | ||
Patient pat = new Patient("P1", "[email protected]", "password1", healthInformation); | ||
pat.setPassword("dragonSlayer99"); | ||
assertEquals(pat.getPassword(), "dragonSlayer99"); | ||
|
@@ -173,5 +173,25 @@ public void testAppointmentSetGetDate(){ | |
apt.setStartTime(newStart); | ||
assertEquals(apt.getStartTime(), newStart); | ||
} | ||
@Test | ||
public void testHealthInformationSetGetDate(){ | ||
Date birth = new Date(100, 1 , 1); | ||
HealthInformation healthInformation = new HealthInformation(birth,100,"Female"); | ||
assertEquals(healthInformation.getDateOfBirth(), birth); | ||
} | ||
|
||
@Test | ||
public void testHealthInformationSetGetGender(){ | ||
Date birth = new Date(100, 1 , 1); | ||
HealthInformation healthInformation = new HealthInformation(birth,100,"Female"); | ||
assertEquals(healthInformation.getGender(), "Female"); | ||
} | ||
|
||
@Test | ||
public void testHealthInformationSetGetWeight(){ | ||
Date birth = new Date(100, 1 , 1); | ||
HealthInformation healthInformation = new HealthInformation(birth,100,"Female"); | ||
assertEquals(healthInformation.getWeight(), 100); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters