# Conflicts:
#	OlympusServices/.idea/caches/build_file_checksums.ser
This commit is contained in:
IvanaE 2018-11-14 14:15:06 -05:00
commit 6f88a7bc71
3 changed files with 39 additions and 0 deletions

View file

@ -99,6 +99,7 @@ public class ServiceProvider extends UserType {
public void setAvailabilities(int[][] availabilities) {
this.availabilities = availabilities;
}
public void setServices(List<Service> services) {
this.services = services;
}

View file

@ -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() );
}
}