diff --git a/OlympusServices/.idea/caches/build_file_checksums.ser b/OlympusServices/.idea/caches/build_file_checksums.ser deleted file mode 100644 index 004dcba..0000000 Binary files a/OlympusServices/.idea/caches/build_file_checksums.ser and /dev/null 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 new file mode 100644 index 0000000..2816c2a --- /dev/null +++ b/OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/ServiceProviderTest2.java @@ -0,0 +1,38 @@ +package com.uottawa.olympus.olympusservices; + +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