Merge branch 'master' of https://github.com/ebivibe/SEG2105-Olympus
# Conflicts: # OlympusServices/.idea/caches/build_file_checksums.ser
This commit is contained in:
commit
60f9008151
3 changed files with 39 additions and 0 deletions
Binary file not shown.
|
@ -99,6 +99,7 @@ public class ServiceProvider extends UserType {
|
||||||
public void setAvailabilities(int[][] availabilities) {
|
public void setAvailabilities(int[][] availabilities) {
|
||||||
this.availabilities = availabilities;
|
this.availabilities = availabilities;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setServices(List<Service> services) {
|
public void setServices(List<Service> services) {
|
||||||
this.services = services;
|
this.services = services;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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() );
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue