Added UML and Test file fixes, added string description to the DBHelper and SignUp. Further fixes needed
This commit is contained in:
		
							parent
							
								
									617b75b997
								
							
						
					
					
						commit
						e08f9464d1
					
				
					 5 changed files with 21 additions and 7 deletions
				
			
		| 
						 | 
				
			
			@ -29,6 +29,7 @@ public class ServiceProvider extends UserType {
 | 
			
		|||
    private String phonenumber;
 | 
			
		||||
    private String companyname;
 | 
			
		||||
    private boolean licensed;
 | 
			
		||||
    private String description;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -43,7 +44,7 @@ public class ServiceProvider extends UserType {
 | 
			
		|||
     * @param lastname String of the lastname.
 | 
			
		||||
     */
 | 
			
		||||
    ServiceProvider(String username, String password, String firstname, String lastname, String address,
 | 
			
		||||
                    String phonenumber, String companyname, boolean licensed){
 | 
			
		||||
                    String phonenumber, String companyname, boolean licensed, String description){
 | 
			
		||||
        super(username, password, firstname, lastname);
 | 
			
		||||
        services = new ArrayList<>();
 | 
			
		||||
        availabilities = new int[7][4];
 | 
			
		||||
| 
						 | 
				
			
			@ -51,6 +52,7 @@ public class ServiceProvider extends UserType {
 | 
			
		|||
        this.phonenumber = phonenumber;
 | 
			
		||||
        this.companyname = companyname;
 | 
			
		||||
        this.licensed = licensed;
 | 
			
		||||
        this.description = description;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -139,4 +141,12 @@ public class ServiceProvider extends UserType {
 | 
			
		|||
    public void setLicensed(boolean licensed) {
 | 
			
		||||
        this.licensed = licensed;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public String getDescription() {
 | 
			
		||||
        return description;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setDescription(String phonenumber) {
 | 
			
		||||
        this.description = description;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -9,7 +9,7 @@ import static org.junit.Assert.*;
 | 
			
		|||
public class ServiceProviderTest {
 | 
			
		||||
 | 
			
		||||
    ServiceProvider serviceprovider = new ServiceProvider("John123", "1234567890", "John", "Doe",
 | 
			
		||||
            "testaddress", "8888888888", "companydotcom", true);
 | 
			
		||||
            "testaddress", "8888888888", "companydotcom", true, "LOL");
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Initiates an ServiceProvider account and tests if the random strings match to the required inputs.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,7 +6,7 @@ import static org.junit.Assert.*;
 | 
			
		|||
 | 
			
		||||
public class ServiceProviderTest2 {
 | 
			
		||||
    ServiceProvider serviceprovider = new ServiceProvider("John123", "1234567890", "John", "Doe",
 | 
			
		||||
            "testaddress", "8888888888", "companydotcom", true);
 | 
			
		||||
            "testaddress", "8888888888", "companydotcom", true, "LOL");
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * sets availabilities and tests them.
 | 
			
		||||
| 
						 | 
				
			
			@ -33,13 +33,16 @@ public class ServiceProviderTest2 {
 | 
			
		|||
        assertEquals( "8888888888", serviceprovider.getPhonenumber() );
 | 
			
		||||
        assertEquals( "companydotcom", serviceprovider.getCompanyname() );
 | 
			
		||||
        assertEquals( true, serviceprovider.isLicensed() );
 | 
			
		||||
        assertEquals( "LOL", serviceprovider.getDescription() );
 | 
			
		||||
        serviceprovider.setAddress( "Canada, Ontario" );
 | 
			
		||||
        serviceprovider.setPhonenumber( "+1-416-555-0182" );
 | 
			
		||||
        serviceprovider.setCompanyname( "Google" );
 | 
			
		||||
        serviceprovider.setLicensed( false );
 | 
			
		||||
        serviceprovider.setDescription( "Nope" );
 | 
			
		||||
        assertNotEquals( "testaddress", serviceprovider.getAddress() );
 | 
			
		||||
        assertNotEquals( "8888888888", serviceprovider.getPhonenumber() );
 | 
			
		||||
        assertNotEquals( "companydotcom", serviceprovider.getCompanyname() );
 | 
			
		||||
        assertNotEquals( true, serviceprovider.isLicensed() );
 | 
			
		||||
        assertNotEquals( "LOL", serviceprovider.getDescription() );
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue