From 3be59387a42b0a8ef8a2446b19345fa602f2c73e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Berk=20Ba=C5=9Fo=C4=9Flu?= Date: Wed, 14 Nov 2018 12:26:28 -0500 Subject: [PATCH 1/3] Updated the branch --- .../.idea/caches/build_file_checksums.ser | Bin 537 -> 537 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/OlympusServices/.idea/caches/build_file_checksums.ser b/OlympusServices/.idea/caches/build_file_checksums.ser index 38a3339a39a9f8bf319e0b21fe4cceff5dfb0cf4..882cd32d166702e4b7e921104d08ffccbb35dbb8 100644 GIT binary patch delta 37 vcmV+=0NVeV1epYomj!1NGT?EsoIU{%t>;(;fV1x{@Fb9iD3`ZAlj;F49!d|& delta 37 tcmbQqGLvP(bk?+s&#D$|oMXo*;2NaTSe`HR$8~;kQ@G*AA% From 2eb8555ae5539d7a4bebc0c6fb16dae18679c45e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Berk=20Ba=C5=9Fo=C4=9Flu?= Date: Wed, 14 Nov 2018 12:45:59 -0500 Subject: [PATCH 2/3] Added 2 Test Cases --- .../olympusservices/ServiceProviderTest2.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/ServiceProviderTest2.java 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..848b90d --- /dev/null +++ b/OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/ServiceProviderTest2.java @@ -0,0 +1,16 @@ +package com.uottawa.olympus.olympusservices; + +import org.junit.Test; + +import static org.junit.Assert.*; + +public class ServiceProviderTest2 { + + @Test + public void testAvailabilities() { + } + + @Test + public void testOtherInstances() { + } +} \ No newline at end of file From 24b16fd8b184327eba5d13e9e9d202edf556aa56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Berk=20Ba=C5=9Fo=C4=9Flu?= Date: Wed, 14 Nov 2018 13:59:26 -0500 Subject: [PATCH 3/3] Finished the test files --- .../.idea/caches/build_file_checksums.ser | Bin 537 -> 537 bytes .../olympusservices/ServiceProvider.java | 1 + .../olympusservices/ServiceProviderTest2.java | 22 ++++++++++++++++++ 3 files changed, 23 insertions(+) diff --git a/OlympusServices/.idea/caches/build_file_checksums.ser b/OlympusServices/.idea/caches/build_file_checksums.ser index 882cd32d166702e4b7e921104d08ffccbb35dbb8..7999a2ece09630c808ecd3ab79d1cefd7344839c 100644 GIT binary patch delta 34 qcmbQqGLvP(Oy&gBl!yK;@;wC2gmjNbs-x(##y delta 34 scmV+-0NwwY1epYonFBK5agm&N5TO!PLv>x09C%0ZO#RF9zmp>Y_V+vwjQ{`u 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