From ce0ead94e020f5f0b0adbd995ba7d56ea8cf319d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Berk=20Ba=C5=9Fo=C4=9Flu?= Date: Wed, 7 Nov 2018 13:28:41 -0500 Subject: [PATCH 1/2] Testing --- .../.idea/caches/build_file_checksums.ser | Bin 537 -> 537 bytes .../olympus/olympusservices/LogInTest.java | 1 - 2 files changed, 1 deletion(-) diff --git a/OlympusServices/.idea/caches/build_file_checksums.ser b/OlympusServices/.idea/caches/build_file_checksums.ser index 4c7ae2cb6fe400b7e4228637a4b4ed7858152f3c..c6475821fae657d69e411dbbe7ad0a00aa09ac84 100644 GIT binary patch delta 65 zcmV-H0KWg31epYonFDQM#gUwe4=6)ATvc;ra&uf_VRUt9lePgilO+Lg6Gc)afp>2b X{6(K*f>$BX3UmMwlfMBQlL!J4BU2XY delta 59 zcmV-B0L1^91epYonF9$r0+F1FlWGBQAtC;BA{s#RADTG+Q)o0Nu5Lpoelb7gXK RTuF9eZef!&0XCED0WEhP6(axu diff --git a/OlympusServices/app/src/androidTest/java/com/uottawa/olympus/olympusservices/LogInTest.java b/OlympusServices/app/src/androidTest/java/com/uottawa/olympus/olympusservices/LogInTest.java index 6828df5..0487845 100644 --- a/OlympusServices/app/src/androidTest/java/com/uottawa/olympus/olympusservices/LogInTest.java +++ b/OlympusServices/app/src/androidTest/java/com/uottawa/olympus/olympusservices/LogInTest.java @@ -17,7 +17,6 @@ public class LogInTest { @Test public void checkSignIn() throws Exception{ - //Lalala } } \ No newline at end of file From 57429abb8e3988ee9e9ec139ba4f362ef96ba3d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Berk=20Ba=C5=9Fo=C4=9Flu?= Date: Wed, 7 Nov 2018 13:47:06 -0500 Subject: [PATCH 2/2] Added comments to test files --- .../uottawa/olympus/olympusservices/AdminTest.java | 4 ++++ .../olympus/olympusservices/HomeOwnerTest.java | 4 ++++ .../olympusservices/ServiceProviderTest.java | 13 +++++++++++-- .../olympus/olympusservices/ServiceTest.java | 10 ++++++++++ .../olympus/olympusservices/UserTypeTest.java | 4 ++++ 5 files changed, 33 insertions(+), 2 deletions(-) diff --git a/OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/AdminTest.java b/OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/AdminTest.java index 2eabc9d..38008b6 100644 --- a/OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/AdminTest.java +++ b/OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/AdminTest.java @@ -6,6 +6,10 @@ import static org.junit.Assert.*; public class AdminTest { + /** + * Initiates an Admin account and tests if the strings match to the required inputs. + */ + @Test public void testAdmin() { Admin admin = new Admin(); diff --git a/OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/HomeOwnerTest.java b/OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/HomeOwnerTest.java index 1453b21..47d33a8 100644 --- a/OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/HomeOwnerTest.java +++ b/OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/HomeOwnerTest.java @@ -6,6 +6,10 @@ import static org.junit.Assert.*; public class HomeOwnerTest { + /** + * Initiates an Homeowner account and tests if the random strings match to the required inputs. + */ + @Test public void testHomeOwner(){ UserType user = new HomeOwner( "John123", "1234567890", "John", "Doe" ); 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 d28fc45..ab776d1 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 @@ -10,6 +10,10 @@ public class ServiceProviderTest { ServiceProvider serviceprovider = new ServiceProvider("John123", "1234567890", "John", "Doe"); + /** + * Initiates an ServiceProvider account and tests if the random strings match to the required inputs. + */ + @Test public void testServiceProvider() { assertEquals( "John123", serviceprovider.getUsername() ); @@ -27,13 +31,18 @@ public class ServiceProviderTest { assertNotEquals("Doe", serviceprovider.getLastname()); } + /** + * adds services and tests if they match the requirements in order to function properly. Example: If a service has a same name it doesn't count as one. + * + */ + @Test public void addServiceTest() { serviceprovider.addService( new Service( "KitchenCleaner", 50 ) ); serviceprovider.addService( new Service( "FrenchMaid", 250 ) ); - serviceprovider.addService( new Service( "FrenchMaid", 250 ) ); - serviceprovider.addService( new Service( "SecretService", 150 ) ); + serviceprovider.addService( new Service( "FrenchMaid", 210 ) ); serviceprovider.addService( new Service( "SecretService", 150 ) ); + serviceprovider.addService( new Service( "SecretService", 110 ) ); int numOfServices = serviceprovider.getServices().size(); assertEquals( 3, numOfServices ); } diff --git a/OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/ServiceTest.java b/OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/ServiceTest.java index ea1d487..6402296 100644 --- a/OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/ServiceTest.java +++ b/OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/ServiceTest.java @@ -7,6 +7,10 @@ import static org.junit.Assert.*; public class ServiceTest { Service service = new Service( "FrenchMaid", 250 ); + /** + * Initiates an Service account and tests if the random strings match to the required inputs. + */ + @Test public void testService(){ assertEquals( "FrenchMaid", service.getName() ); @@ -17,12 +21,18 @@ public class ServiceTest { assertNotEquals( 250, service.getRate()); } + /** + * adds service providers and tests if they match the requirements in order to function properly. Example: If a service has a same name it doesn't count as one. + * + */ + @Test public void addServiceProviderTest(){ service.addServiceProvider( new ServiceProvider( "John123", "1234567890", "John", "Doe" ) ); service.addServiceProvider( new ServiceProvider( "Jane123", "1234567890", "Jane", "Doe" ) ); service.addServiceProvider( new ServiceProvider( "John123", "1234567890", "John", "Doe" ) ); service.addServiceProvider( new ServiceProvider( "Jane123", "1234567890", "Jane", "Doe" ) ); + service.addServiceProvider( new ServiceProvider( "Jane123", "1234567890", "John", "Doe" ) ); int numOfSP = service.getServiceProviders().size(); assertEquals( 2,numOfSP ); } diff --git a/OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/UserTypeTest.java b/OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/UserTypeTest.java index 1934f15..12d173d 100644 --- a/OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/UserTypeTest.java +++ b/OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/UserTypeTest.java @@ -11,6 +11,10 @@ import static org.junit.Assert.*; public class UserTypeTest { + /** + * Tests if the every user that is created is equal to each other or not. + */ + @Test public void userTypeComparaison() { UserType user = new HomeOwner("John123", "1234567890", "John", "Doe");