package no.priv.bang.ukelonn.impl;

import static org.junit.Assert.*;

import org.junit.Test;

public class UserTest {

    @Test
    public void testEquals() {
        User user = new User(1, "jad", "jane21@gmail.com", "Jane", "Doe");
        User userDifferentUserId = new User(2, "jad", "jane21@gmail.com", "Jane", "Doe");
        assertNotEquals(user, userDifferentUserId);
        User userDifferentUsername = new User(1, "jadd", "jane21@gmail.com", "Jane", "Doe");
        assertNotEquals(user, userDifferentUsername);
        User userDifferentEmail = new User(1, "jad", "jane22@gmail.com", "Jane", "Doe");
        assertNotEquals(user, userDifferentEmail);
        User userDifferentFirstname = new User(1, "jad", "jane21@gmail.com", "Julie", "Doe");
        assertNotEquals(user, userDifferentFirstname);
        User userDifferentLastname = new User(1, "jad", "jane21@gmail.com", "Jane", "Deer");
        assertNotEquals(user, userDifferentLastname);
        User equalUser = new User(1, "jad", "jane21@gmail.com", "Jane", "Doe");
        assertEquals(user, equalUser);
        assertEquals(user, user);
        User userWithNullStrings = new User(1, null, null, null, null);
        assertNotEquals(userWithNullStrings, user);
        assertNotEquals(user, null);
        assertNotEquals(user, "");
    }

}

@@ -113,16 +113,1384 @@
 Test %7B%0A%0A
+    @Test%0A    public void testProperties() %7B%0A        int expectedUserId = 1;%0A        String expectedUsername = %22jad%22;%0A        String expectedEmail = %22jane21@gmail.com%22;%0A        String expectedFirstname = %22Jane%22;%0A        String expectedLastname = %22Doe%22;%0A        User user = new User(expectedUserId, expectedUsername, expectedEmail, expectedFirstname, expectedLastname);%0A        assertEquals(expectedUserId, user.getUserId());%0A        assertEquals(expectedUsername, user.getUsername());%0A        assertEquals(expectedEmail, user.getEmail());%0A        assertEquals(expectedFirstname, user.getFirstname());%0A        assertEquals(expectedLastname, user.getLastname());%0A        assertEquals(%22Jane Doe%22, user.getFullname());%0A%0A        String newUsername = %22jadd%22;%0A        String newEmail = %22jane2111@gmail.com%22;%0A        String newFirstname = %22Juliet%22;%0A        String newLastname = %22Deere%22;%0A        user.setUsername(newUsername);%0A        assertEquals(newUsername, user.getUsername());%0A        user.setEmail(newEmail);%0A        assertEquals(newEmail, user.getEmail());%0A        user.setFirstname(newFirstname);%0A        assertEquals(newFirstname, user.getFirstname());%0A        assertEquals(%22Juliet Doe%22, user.getFullname());%0A        user.setLastname(newLastname);%0A        assertEquals(newLastname, user.getLastname());%0A        assertEquals(%22Juliet Deere%22, user.getFullname());%0A    %7D%0A%0A
     @Tes
@@ -2678,10 +2678,775 @@
 %0A    %7D%0A%0A
+    @Test%0A    public void testHashCode() %7B%0A        User user = new User(1, %22jad%22, %22jane21@gmail.com%22, %22Jane%22, %22Doe%22);%0A        assertEquals(521560053, user.hashCode());%0A        User userWithNullStrings = new User(1, null, null, null, null);%0A        assertEquals(28629182, userWithNullStrings.hashCode());%0A    %7D%0A%0A    @Test%0A    public void testToString() %7B%0A        User user = new User(1, %22jad%22, %22jane21@gmail.com%22, %22Jane%22, %22Doe%22);%0A        assertEquals(%22User %5BuserId=1, username=jad, email=jane21@gmail.com, firstname=Jane, lastname=Doe%5D%22, user.toString());%0A        User userWithNullStrings = new User(1, null, null, null, null);%0A        assertEquals(%22User %5BuserId=1, username=null, email=null, firstname=null, lastname=null%5D%22, userWithNullStrings.toString());%0A    %7D%0A%0A
 %7D%0A

Add tests for bean User.