diff --git a/OlympusServices/.idea/caches/build_file_checksums.ser b/OlympusServices/.idea/caches/build_file_checksums.ser index 882cd32..7999a2e 100644 Binary files a/OlympusServices/.idea/caches/build_file_checksums.ser and b/OlympusServices/.idea/caches/build_file_checksums.ser differ 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 b768ad8..c9dd250 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 @@ -99,6 +99,7 @@ public class ServiceProvider extends UserType { public void setAvailabilities(int[][] availabilities) { this.availabilities = availabilities; } + public void setServices(List services) { this.services = services; } 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 848b90d..2816c2a 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 @@ -5,12 +5,34 @@ import org.junit.Test; import static org.junit.Assert.*; public class ServiceProviderTest2 { + ServiceProvider serviceprovider = new ServiceProvider("John123", "1234567890", "John", "Doe", + "testaddress", "8888888888", "companydotcom", true); @Test public void testAvailabilities() { + int [][] availability = new int[7][4]; + assertEquals( availability, serviceprovider.getAvailabilities()); + serviceprovider.setAvailabilities(5, 8, 30, 12, 0); + availability[5][0] = 8; + availability[5][1] = 30; + availability[5][2] = 12; + availability[5][3] = 0; + assertEquals( availability, serviceprovider.getAvailabilities()); } @Test public void testOtherInstances() { + assertEquals( "testaddress", serviceprovider.getAddress() ); + assertEquals( "8888888888", serviceprovider.getPhonenumber() ); + assertEquals( "companydotcom", serviceprovider.getCompanyname() ); + assertEquals( true, serviceprovider.isLicensed() ); + serviceprovider.setAddress( "Canada, Ontario" ); + serviceprovider.setPhonenumber( "+1-416-555-0182" ); + serviceprovider.setCompanyname( "Google" ); + serviceprovider.setLicensed( false ); + assertNotEquals( "testaddress", serviceprovider.getAddress() ); + assertNotEquals( "8888888888", serviceprovider.getPhonenumber() ); + assertNotEquals( "companydotcom", serviceprovider.getCompanyname() ); + assertNotEquals( true, serviceprovider.isLicensed() ); } } \ No newline at end of file