package com.zoinks.waterreporting;

import com.zoinks.waterreporting.model.Facade;
import com.zoinks.waterreporting.model.UserType

import org.junit.Test;

import static org.junit.Assert.*;

/**
 * Example local unit test, which will execute on the development machine (host).
 *
 * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
 */
public class RegisterTest {
    @Test
    public void nullFirstName(){
        Facade facade = Facade.getInstance();
        assertEquals(facade.registerUser(null, "lastName", "username", "password", UserType.USER), false);
    }

    public void nullLastName(){
        Facade facade = Facade.getInstance();
        assertEquals(facade.registerUser("firstName", null, "username", "password", UserType.USER), false);
    }

    public void nullUsername(){
        Facade facade = Facade.getInstance();
        assertEquals(facade.registerUser("firstName", "lastName", null, "password", UserType.USER), false);
    }

    public void nullPassword(){
        Facade facade = Facade.getInstance();
        assertEquals(facade.registerUser("firstName", "lastName", "username", null, UserType.USER), false);
    }

    public void nullUserType(){
        Facade facade = Facade.getInstance();
        assertEquals(facade.registerUser("firstName", "lastName", "username", "password", null), false);
    }

    public void nullAllFields(){
        Facade facade = Facade.getInstance();
        assertEquals(facade.registerUser(null, null, null, null, null), false);
    }

    public void takenUsername(){
        Facade facade = Facade.getInstance();
        facade.registerUser("firstName", "lastName", "originalUsername", "password", UserType.USER);
        assertEquals(facade.registerUser("firstName", "lastName", "originalUsername", "password", UserType.USER), false);
    }

    public void registerSuccessfully(){
        Facade facade = Facade.getInstance();
        assertEquals(facade.registerUser("firstName", "lastName", "username", "password", UserType.USER), true);
    }
}
@@ -123,17 +123,18 @@
 UserType
+;
 %0A
-
 %0Aimport 
@@ -580,32 +580,42 @@
  false);%0A    %7D%0A%0A
+    @Test%0A
     public void 
@@ -783,32 +783,42 @@
  false);%0A    %7D%0A%0A
+    @Test%0A
     public void 
@@ -986,32 +986,42 @@
  false);%0A    %7D%0A%0A
+    @Test%0A
     public void 
@@ -1189,32 +1189,42 @@
  false);%0A    %7D%0A%0A
+    @Test%0A
     public void 
@@ -1389,32 +1389,42 @@
  false);%0A    %7D%0A%0A
+    @Test%0A
     public void 
@@ -1565,32 +1565,42 @@
  false);%0A    %7D%0A%0A
+    @Test%0A
     public void 
@@ -1888,24 +1888,34 @@
 se);%0A    %7D%0A%0A
+    @Test%0A
     public v

update to Register tests