diff --git a/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/ServiceProvider.java b/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/ServiceProvider.java index c9dd250..f339e6f 100644 --- a/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/ServiceProvider.java +++ b/OlympusServices/app/src/main/java/com/uottawa/olympus/olympusservices/ServiceProvider.java @@ -29,6 +29,7 @@ public class ServiceProvider extends UserType { private String phonenumber; private String companyname; private boolean licensed; + private String description; @@ -43,7 +44,7 @@ public class ServiceProvider extends UserType { * @param lastname String of the lastname. */ ServiceProvider(String username, String password, String firstname, String lastname, String address, - String phonenumber, String companyname, boolean licensed){ + String phonenumber, String companyname, boolean licensed, String description){ super(username, password, firstname, lastname); services = new ArrayList<>(); availabilities = new int[7][4]; @@ -51,6 +52,7 @@ public class ServiceProvider extends UserType { this.phonenumber = phonenumber; this.companyname = companyname; this.licensed = licensed; + this.description = description; } /** @@ -139,4 +141,12 @@ public class ServiceProvider extends UserType { public void setLicensed(boolean licensed) { this.licensed = licensed; } + + public String getDescription() { + return description; + } + + public void setDescription(String phonenumber) { + this.description = description; + } } \ No newline at end of file diff --git a/OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/ServiceProviderTest.java b/OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/ServiceProviderTest.java index 7f5b5e8..4e721d3 100644 --- a/OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/ServiceProviderTest.java +++ b/OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/ServiceProviderTest.java @@ -9,7 +9,7 @@ import static org.junit.Assert.*; public class ServiceProviderTest { ServiceProvider serviceprovider = new ServiceProvider("John123", "1234567890", "John", "Doe", - "testaddress", "8888888888", "companydotcom", true); + "testaddress", "8888888888", "companydotcom", true, "LOL"); /** * Initiates an ServiceProvider account and tests if the random strings match to the required inputs. diff --git a/OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/ServiceProviderTest2.java b/OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/ServiceProviderTest2.java index fb0e454..38353f2 100644 --- a/OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/ServiceProviderTest2.java +++ b/OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/ServiceProviderTest2.java @@ -6,7 +6,7 @@ import static org.junit.Assert.*; public class ServiceProviderTest2 { ServiceProvider serviceprovider = new ServiceProvider("John123", "1234567890", "John", "Doe", - "testaddress", "8888888888", "companydotcom", true); + "testaddress", "8888888888", "companydotcom", true, "LOL"); /** * sets availabilities and tests them. @@ -33,13 +33,16 @@ public class ServiceProviderTest2 { assertEquals( "8888888888", serviceprovider.getPhonenumber() ); assertEquals( "companydotcom", serviceprovider.getCompanyname() ); assertEquals( true, serviceprovider.isLicensed() ); + assertEquals( "LOL", serviceprovider.getDescription() ); serviceprovider.setAddress( "Canada, Ontario" ); serviceprovider.setPhonenumber( "+1-416-555-0182" ); serviceprovider.setCompanyname( "Google" ); serviceprovider.setLicensed( false ); + serviceprovider.setDescription( "Nope" ); assertNotEquals( "testaddress", serviceprovider.getAddress() ); assertNotEquals( "8888888888", serviceprovider.getPhonenumber() ); assertNotEquals( "companydotcom", serviceprovider.getCompanyname() ); assertNotEquals( true, serviceprovider.isLicensed() ); + assertNotEquals( "LOL", serviceprovider.getDescription() ); } } \ No newline at end of file diff --git a/ProjectUML.ump b/ProjectUML.ump index 7f0d4a4..361d4a8 100644 --- a/ProjectUML.ump +++ b/ProjectUML.ump @@ -18,6 +18,7 @@ address; int phonenumber; companyname; boolean licensed; +description; isA UserType; } @@ -33,7 +34,7 @@ double rate; * -- * ServiceProvider; } -//$?[End_of_model]$? + class UserType { @@ -57,6 +58,6 @@ class Admin class Service { - position 853 422 112 75; - position.association Service__ServiceProvider 65,0 61,126; -} \ No newline at end of file + position 854 455 112 75; + position.association Service__ServiceProvider 65,0 65,143; +}//$?[End_of_model]$? \ No newline at end of file diff --git a/UML Class Diagram.docx b/UML Class Diagram.docx index b59383f..5d4af73 100644 Binary files a/UML Class Diagram.docx and b/UML Class Diagram.docx differ