From d3550b9ea802e00ad8518571e1ea1c21bd0183cd Mon Sep 17 00:00:00 2001 From: IvanaE Date: Tue, 13 Nov 2018 14:00:01 -0500 Subject: [PATCH] think i got them all --- .../olympusservices/DBIntegrationTest.java | 24 ++++++++++++------- .../olympus/olympusservices/UserTypeTest.java | 3 ++- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/DBIntegrationTest.java b/OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/DBIntegrationTest.java index 1eea087..7a38f8a 100644 --- a/OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/DBIntegrationTest.java +++ b/OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/DBIntegrationTest.java @@ -48,7 +48,8 @@ public class DBIntegrationTest { assertEquals("Garzon", dbUser.getLastname()); - originalUser = new ServiceProvider("jbO4aBF4dC", "seg2105", "Juan", "Guzman"); + originalUser = new ServiceProvider("jbO4aBF4dC", "seg2105", "Juan", "Guzman", + "testaddress", "8888888888", "companydotcom", true); addedTwo = dbHelper.addUser(originalUser); dbUser = dbHelper.findUserByUsername("jbO4aBF4dC"); @@ -79,7 +80,8 @@ public class DBIntegrationTest { assertTrue(added); added = dbHelper.addUser(new HomeOwner("jbO4aBF4dC", "seg2105", "Miguel", "Garzon")); assertTrue(!added); - added = dbHelper.addUser(new ServiceProvider("jbO4aBF4dC", "seg2105", "Juan", "Guzman")); + added = dbHelper.addUser(new ServiceProvider("jbO4aBF4dC", "seg2105", "Juan", "Guzman", + "testaddress", "8888888888", "companydotcom", true)); assertTrue(!added); dbHelper.deleteUser("jbO4aBF4dC"); @@ -212,7 +214,8 @@ public class DBIntegrationTest { @Test public void testAddAndDeleteServiceProvidedByUser(){ - dbHelper.addUser(new ServiceProvider("jbO4aBF4dC", null, null, null)); + dbHelper.addUser(new ServiceProvider("jbO4aBF4dC", null, null, null, + "testaddress", "8888888888", "companydotcom", true)); dbHelper.addService(new Service("Hitman", 12358)); boolean added = dbHelper.addServiceProvidedByUser("jbO4aBF4dC", "hitman"); assertTrue(added); @@ -224,7 +227,8 @@ public class DBIntegrationTest { @Test public void testGetAllServicesProvidedByUserAndDeleteService(){ - dbHelper.addUser(new ServiceProvider("jbO4aBF4dC", null, null, null)); + dbHelper.addUser(new ServiceProvider("jbO4aBF4dC", null, null, null, + "testaddress", "8888888888", "companydotcom", true)); dbHelper.addService(new Service("Hitman", 12358)); dbHelper.addService(new Service("Exterminating flatworms", 392.457)); @@ -253,8 +257,10 @@ public class DBIntegrationTest { @Test public void testGetAllProvidersByService(){ dbHelper.addService(new Service("Exterminating flatworms", 392.457)); - dbHelper.addUser(new ServiceProvider("jbO4aBF4dC", null, null, null)); - dbHelper.addUser(new ServiceProvider("7MuF1c59XP", null, null, null)); + dbHelper.addUser(new ServiceProvider("jbO4aBF4dC", null, null, null, + "testaddress", "8888888888", "companydotcom", true)); + dbHelper.addUser(new ServiceProvider("7MuF1c59XP", null, null, null, + "testaddress", "8888888888", "companydotcom", true)); dbHelper.addServiceProvidedByUser("jbO4aBF4dC", "exterminating flatworms"); dbHelper.addServiceProvidedByUser("7MuF1c59XP", "exterminating flatworms"); @@ -272,12 +278,14 @@ public class DBIntegrationTest { @Test public void testUpdateAndGetAvailability(){ - ServiceProvider serviceProvider = new ServiceProvider("jbO4aBF4dC", null, null, null); + ServiceProvider serviceProvider = new ServiceProvider("jbO4aBF4dC", null, null, null, + "testaddress", "8888888888", "companydotcom", true); serviceProvider.setAvailabilities(0, 4, 18, 19, 30); serviceProvider.setAvailabilities(3, 8, 12, 15, 14); //TODO:Perhaps implement a deep clone function for UserType? - ServiceProvider serviceProvider2 = new ServiceProvider("jbO4aBF4dC", null, null, null); + ServiceProvider serviceProvider2 = new ServiceProvider("jbO4aBF4dC", null, null, null, + "testaddress", "8888888888", "companydotcom", true); serviceProvider2.setAvailabilities(0, 4, 18, 19, 30); serviceProvider2.setAvailabilities(3, 8, 12, 15, 14); 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 12d173d..8660968 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 @@ -19,7 +19,8 @@ public class UserTypeTest { public void userTypeComparaison() { UserType user = new HomeOwner("John123", "1234567890", "John", "Doe"); UserType admin = new Admin(); - UserType serviceprovider = new ServiceProvider( "Jane123", "1234567890", "Jane", "Doe"); + UserType serviceprovider = new ServiceProvider( "Jane123", "1234567890", "Jane", "Doe", + "testaddress", "8888888888", "companydotcom", true); boolean userservice = user.equals(serviceprovider); boolean useradmin = user.equals(admin); boolean serviceadmin = serviceprovider.equals(admin);