added all test files
This commit is contained in:
parent
4fcbb34f38
commit
295242e572
2 changed files with 54 additions and 1 deletions
|
@ -8,7 +8,34 @@ import static org.junit.Assert.*;
|
|||
|
||||
public class ServiceProviderTest {
|
||||
|
||||
ServiceProvider serviceprovider = new ServiceProvider("John123", "1234567890", "John", "Doe");
|
||||
|
||||
@Test
|
||||
public void addService() {
|
||||
public void testServiceProvider() {
|
||||
assertEquals( "John123", serviceprovider.getUsername() );
|
||||
assertEquals( "1234567890", serviceprovider.getPassword() );
|
||||
assertEquals( "John", serviceprovider.getFirstname() );
|
||||
assertEquals( "Doe", serviceprovider.getLastname() );
|
||||
assertEquals( "ServiceProvider", serviceprovider.getRole() );
|
||||
serviceprovider.setUsername( "username" );
|
||||
serviceprovider.setPassword( "password" );
|
||||
serviceprovider.setFirstname( "firstname" );
|
||||
serviceprovider.setLastname( "lastname" );
|
||||
assertNotEquals("John123", serviceprovider.getUsername());
|
||||
assertNotEquals("1234567890", serviceprovider.getPassword());
|
||||
assertNotEquals("John", serviceprovider.getFirstname());
|
||||
assertNotEquals("Doe", serviceprovider.getLastname());
|
||||
}
|
||||
|
||||
@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( "SecretService", 150 ) );
|
||||
int numOfServices = serviceprovider.getServices().size();
|
||||
assertEquals( 3, numOfServices );
|
||||
}
|
||||
|
||||
}
|
|
@ -1,4 +1,30 @@
|
|||
package com.uottawa.olympus.olympusservices;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
public class ServiceTest {
|
||||
Service service = new Service( "FrenchMaid", 250 );
|
||||
|
||||
@Test
|
||||
public void testService(){
|
||||
assertEquals( "FrenchMaid", service.getName() );
|
||||
assertEquals( 250, service.getRate(), 0);
|
||||
service.setName( "ItalianMafia" );
|
||||
service.setRate( 200 );
|
||||
assertNotEquals( "FrenchMaid", service.getName() );
|
||||
assertNotEquals( 250, service.getRate());
|
||||
}
|
||||
|
||||
@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" ) );
|
||||
int numOfSP = service.getServiceProviders().size();
|
||||
assertEquals( 2,numOfSP );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue