public class UserTest {
@Test
public void testEquals()
{
User user = new User( 0, "Huge", "Notte", "viva", "geilo", "huge.notte@hotmile.com", "0123/12345", new Location(8605, "Kapfenberg"), new Date(9999), "sessionID" );
Assert.assertTrue(user.equals(user));
Assert.assertTrue(user.equals(new User( 0, "Huge", "Notte", "viva", "geilo", "huge.notte@hotmile.com", "0123/12345", new Location(8605, "Kapfenberg"), new Date(9999), "sessionID" )));
Assert.assertFalse(user.equals(new User( 1, "Huge", "Notte", "viva", "geilo", "huge.notte@hotmile.com", "0123/12345", new Location(8605, "Kapfenberg"), new Date(9999), "sessionID" )));
Assert.assertFalse(user.equals(new User( 0, "Bob", "Notte", "viva", "geilo", "huge.notte@hotmile.com", "0123/12345", new Location(8605, "Kapfenberg"), new Date(9999), "sessionID" )));
Assert.assertFalse(user.equals(new User( 0, "Huge", "Lotte", "viva", "geilo", "huge.notte@hotmile.com", "0123/12345", new Location(8605, "Kapfenberg"), new Date(9999), "sessionID" )));
Assert.assertFalse(user.equals(new User( 0, "Huge", "Notte", "nina", "geilo", "huge.notte@hotmile.com", "0123/12345", new Location(8605, "Kapfenberg"), new Date(9999), "sessionID" )));
Assert.assertFalse(user.equals(new User( 0, "Huge", "Notte", "viva", "gusto", "huge.notte@hotmile.com", "0123/12345", new Location(8605, "Kapfenberg"), new Date(9999), "sessionID" )));
Assert.assertFalse(user.equals(new User( 0, "Huge", "Notte", "viva", "geilo", "huge.notte@gmail.com", "0123/12345", new Location(8605, "Kapfenberg"), new Date(9999), "sessionID" )));
Assert.assertFalse(user.equals(new User( 0, "Huge", "Notte", "viva", "geilo", "huge.notte@hotmile.com", "0123/66666", new Location(8605, "Kapfenberg"), new Date(9999), "sessionID" )));
Assert.assertFalse(user.equals(new User( 0, "Huge", "Notte", "viva", "geilo", "huge.notte@hotmile.com", "0123/12345", new Location(8010, "Graz"), new Date(9999), "sessionID" )));
Assert.assertFalse(user.equals(new User( 0, "Huge", "Notte", "viva", "geilo", "huge.notte@hotmile.com", "0123/12345", new Location(8605, "Kapfenberg"), new Date(1111), "sessionID" )));
Assert.assertFalse(user.equals(new User( 0, "Huge", "Notte", "viva", "geilo", "huge.notte@hotmile.com", "0123/12345", new Location(8605, "Kapfenberg"), new Date(9999), "otherSessionID" )));
Assert.assertFalse(new User( 0, "Huge", "Notte", "viva", null, "huge.notte@hotmile.com", "0123/12345", new Location(8605, "Kapfenberg"), new Date(9999), "sessionID" ).equals(user));
Assert.assertFalse(new User( 0, "Huge", "Notte", "viva", "geilo", "huge.notte@hotmile.com", "0123/12345", null, new Date(9999), "sessionID" ).equals(user));
Assert.assertFalse(new User( 0, "Huge", "Notte", "viva", "geilo", "huge.notte@hotmile.com", "0123/12345", new Location(8605, "Kapfenberg"), null, "sessionID" ).equals(user));
Assert.assertFalse(new User( 0, "Huge", "Notte", "viva", "geilo", "huge.notte@hotmile.com", "0123/12345", new Location(8605, "Kapfenberg"), new Date(9999), null ).equals(user));
user = new User( 0, "Huge", "Notte", "viva", null, "huge.notte@hotmile.com", "0123/12345", null,null, null );
Assert.assertFalse(new User( 0, "Huge", "Notte", "viva", "geilo", "huge.notte@hotmile.com", "0123/12345", null, null, null ).equals(user));
Assert.assertFalse(new User( 0, "Huge", "Notte", "viva", null, "huge.notte@hotmile.com", "0123/12345", null, null, "sessionID" ).equals(user));
Assert.assertFalse(new User( 0, "Huge", "Notte", "viva", null, "huge.notte@hotmile.com", "0123/12345", new Location(8605, "Kapfenberg"), null, null ).equals(user));
Assert.assertFalse(new User( 0, "Huge", "Notte", "viva", null, "huge.notte@hotmile.com", "0123/12345", null, new Date(9999), null ).equals(user));
Assert.assertFalse(user.equals("notAUser"));
Assert.assertFalse(user.equals(null));
}