fixed bad constructor

This commit is contained in:
IvanaE 2018-11-16 15:50:56 -05:00
parent d83ae6bb69
commit cb06782c04
8 changed files with 23 additions and 23 deletions

View file

@ -52,7 +52,7 @@ public class DBIntegrationTest {
//add a ServiceProvider to database
originalUser = new ServiceProvider("jbO4aBF4dC", "seg2105", "Juan", "Guzman",
"testaddress", "8888888888", "companydotcom", true, null);
"testaddress", "8888888888", "companydotcom", true);
addedTwo = dbHelper.addUser(originalUser);
//test retrieving ServiceProvider, and confirm that user info is the same as that in object passed
@ -79,7 +79,7 @@ public class DBIntegrationTest {
public void testAddAndGetServiceProvider(){
//ServiceProviders have extra fields that can be added to the DB
ServiceProvider serviceProvider = new ServiceProvider("7MuF1c59XP", null, null, null,
"testaddress", "8888888888", "companydotcom", true, "Not a penguin");
"testaddress", "8888888888", "companydotcom", true);
dbHelper.addUser(serviceProvider);
//retrieve ServiceProvider and test the newly added fields
@ -102,7 +102,7 @@ public class DBIntegrationTest {
public void testDeleteServiceProvider(){
//make sure all the rows related to ServiceProvider in all tables are deleted
ServiceProvider serviceProvider = new ServiceProvider("jbO4aBF4dC", null, null, null,
"testaddress", "8888888888", "companydotcom", true, null);
"testaddress", "8888888888", "companydotcom", true);
dbHelper.addUser(serviceProvider);
Service service1 = new Service("Hitman", 12358);
@ -143,7 +143,7 @@ public class DBIntegrationTest {
added = dbHelper.addUser(new HomeOwner("jbO4aBF4dC", "seg2105", "Miguel", "Garzon"));
assertTrue(!added);
added = dbHelper.addUser(new ServiceProvider("jbO4aBF4dC", "seg2105", "Juan", "Guzman",
"testaddress", "8888888888", "companydotcom", true, null));
"testaddress", "8888888888", "companydotcom", true));
assertTrue(!added);
dbHelper.deleteUser("jbO4aBF4dC");
@ -279,7 +279,7 @@ public class DBIntegrationTest {
@Test
public void testAddAndDeleteServiceProvidedByUser(){
dbHelper.addUser(new ServiceProvider("jbO4aBF4dC", null, null, null,
"testaddress", "8888888888", "companydotcom", true, null));
"testaddress", "8888888888", "companydotcom", true));
dbHelper.addService(new Service("Hitman", 12358));
boolean added = dbHelper.addServiceProvidedByUser("jbO4aBF4dC", "hitman");
assertTrue(added);
@ -292,7 +292,7 @@ public class DBIntegrationTest {
@Test
public void testGetAllServicesProvidedByUserAndDeleteService(){
ServiceProvider serviceProvider = new ServiceProvider("jbO4aBF4dC", null, null, null,
"testaddress", "8888888888", "companydotcom", true, null);
"testaddress", "8888888888", "companydotcom", true);
dbHelper.addUser(serviceProvider);
Service service1 = new Service("Hitman", 12358);
@ -325,9 +325,9 @@ public class DBIntegrationTest {
public void testGetAllProvidersByService(){
dbHelper.addService(new Service("Exterminating flatworms", 392.457));
dbHelper.addUser(new ServiceProvider("jbO4aBF4dC", null, null, null,
"testaddress", "8888888888", "companydotcom", true, null));
"testaddress", "8888888888", "companydotcom", true));
dbHelper.addUser(new ServiceProvider("7MuF1c59XP", null, null, null,
"testaddress", "8888888888", "companydotcom", true, null));
"testaddress", "8888888888", "companydotcom", true));
dbHelper.addServiceProvidedByUser("jbO4aBF4dC", "exterminating flatworms");
dbHelper.addServiceProvidedByUser("7MuF1c59XP", "exterminating flatworms");
@ -347,7 +347,7 @@ public class DBIntegrationTest {
@Test
public void testDeleteServiceProvidedByUser(){
ServiceProvider serviceProvider = new ServiceProvider("jbO4aBF4dC", null, null, null,
"testaddress", "8888888888", "companydotcom", true, null);
"testaddress", "8888888888", "companydotcom", true);
dbHelper.addUser(serviceProvider);
Service service1 = new Service("Hitman", 12358);
@ -377,7 +377,7 @@ public class DBIntegrationTest {
@Test
public void testUpdateAndGetAvailability(){
ServiceProvider serviceProvider = new ServiceProvider("jbO4aBF4dC", null, null, null,
"testaddress", "8888888888", "companydotcom", true, null);
"testaddress", "8888888888", "companydotcom", true);
serviceProvider.setAvailabilities(0, 4, 18, 19, 30);
serviceProvider.setAvailabilities(1, 5, 20, 21, 11);
serviceProvider.setAvailabilities(3, 7, 12, 15, 14);
@ -385,7 +385,7 @@ public class DBIntegrationTest {
//TODO:Perhaps implement a deep clone function for UserType?
ServiceProvider serviceProvider2 = new ServiceProvider("jbO4aBF4dC", null, null, null,
"testaddress", "8888888888", "companydotcom", true, null);
"testaddress", "8888888888", "companydotcom", true);
serviceProvider2.setAvailabilities(0, 4, 18, 19, 30);
serviceProvider2.setAvailabilities(1, 5, 20, 21, 11);
serviceProvider2.setAvailabilities(3, 7, 12, 15, 14);
@ -414,7 +414,7 @@ public class DBIntegrationTest {
@Test
public void testInvalidAvailability(){
ServiceProvider serviceProvider = new ServiceProvider("jbO4aBF4dC", null, null, null,
"testaddress", "8888888888", "companydotcom", true, null);
"testaddress", "8888888888", "companydotcom", true);
serviceProvider.setAvailabilities(2, 8, 14, 8, 14);
serviceProvider.setAvailabilities(3, 15, 12, 8, 14);

View file

@ -9,7 +9,7 @@ import static org.junit.Assert.*;
public class ServiceProviderTest {
ServiceProvider serviceprovider = new ServiceProvider("John123", "1234567890", "John", "Doe",
"testaddress", "8888888888", "companydotcom", true, "LOL");
"testaddress", "8888888888", "companydotcom", true);
/**
* Initiates an ServiceProvider account and tests if the random strings match to the required inputs.

View file

@ -6,7 +6,7 @@ import static org.junit.Assert.*;
public class ServiceProviderTest2 {
ServiceProvider serviceprovider = new ServiceProvider("John123", "1234567890", "John", "Doe",
"testaddress", "8888888888", "companydotcom", true, "LOL");
"testaddress", "8888888888", "companydotcom", true);
/**
* sets availabilities and tests them.

View file

@ -29,15 +29,15 @@ public class ServiceTest {
@Test
public void addServiceProviderTest(){
service.addServiceProvider( new ServiceProvider( "John123", "1234567890", "John", "Doe",
"testaddress", "8888888888", "companydotcom", true, null) );
"testaddress", "8888888888", "companydotcom", true) );
service.addServiceProvider( new ServiceProvider( "Jane123", "1234567890", "Jane", "Doe",
"testaddress", "8888888888", "companydotcom", true, null) );
"testaddress", "8888888888", "companydotcom", true) );
service.addServiceProvider( new ServiceProvider( "John123", "1234567890", "John", "Doe",
"testaddress", "8888888888", "companydotcom", true, null) );
"testaddress", "8888888888", "companydotcom", true) );
service.addServiceProvider( new ServiceProvider( "Jane123", "1234567890", "Jane", "Doe",
"testaddress", "8888888888", "companydotcom", true, null) );
"testaddress", "8888888888", "companydotcom", true) );
service.addServiceProvider( new ServiceProvider( "Jane123", "1234567890", "John", "Doe",
"testaddress", "8888888888", "companydotcom", true, null) );
"testaddress", "8888888888", "companydotcom", true) );
int numOfSP = service.getServiceProviders().size();
assertEquals( 2,numOfSP );
}

View file

@ -20,7 +20,7 @@ public class UserTypeTest {
UserType user = new HomeOwner("John123", "1234567890", "John", "Doe");
UserType admin = new Admin();
UserType serviceprovider = new ServiceProvider( "Jane123", "1234567890", "Jane", "Doe",
"testaddress", "8888888888", "companydotcom", true, "I am a walrus");
"testaddress", "8888888888", "companydotcom", true);
boolean userservice = user.equals(serviceprovider);
boolean useradmin = user.equals(admin);
boolean serviceadmin = serviceprovider.equals(admin);