Re-enabled first test.
[staff/due1/sed-hs15-srs-purple.git] / src / test / java / ch / bfh / ti / srs / core / UserTest.java
CommitLineData
7f912ebe
M
1/*\r
2 * Copyright (c) 2015 Berner Fachhochschule, Switzerland.\r
3 *\r
4 * Project Smart Reservation System.\r
5 *\r
6 * Distributable under GPL license. See terms of license at gnu.org.\r
7 */\r
8package ch.bfh.ti.srs.core;\r
9\r
b1b9997a
ED
10import static org.junit.Assert.assertEquals;\r
11import static org.junit.Assert.assertFalse;\r
12import static org.junit.Assert.assertTrue;\r
7f912ebe 13\r
b1b9997a 14import org.junit.Ignore;\r
7f912ebe
M
15\r
16public class UserTest {\r
7f912ebe 17\r
b1b9997a 18 @Ignore\r
d6a2afc6 19 public void createUserTest() {\r
b1b9997a
ED
20 User testUser = new User("TestUser", "pass");\r
21 assertEquals("TestUser", testUser.getUserName());\r
7f912ebe 22 }\r
b1b9997a
ED
23\r
24 @Ignore\r
d6a2afc6 25 public void checkPasswordTest() {\r
b1b9997a
ED
26 User testUser = new User("TestUser", "pass");\r
27 assertTrue(testUser.checkPassword("pass"));\r
28 assertFalse(testUser.checkPassword("notmypass"));\r
d6a2afc6 29 }\r
b1b9997a
ED
30\r
31 @Ignore\r
d6a2afc6 32 public void changePasswordTest() {\r
b1b9997a
ED
33 User testUser = new User("TestUser", "pass");\r
34 assertTrue(testUser.checkPassword("pass"));\r
35 testUser.changePassword("newpass");\r
36 assertTrue(testUser.checkPassword("newpass"));\r
37 assertFalse(testUser.checkPassword("pass"));\r
38 assertFalse(testUser.checkPassword("notmypass"));\r
d6a2afc6 39 }\r
b1b9997a
ED
40\r
41 @Ignore\r
d6a2afc6 42 public void setMailTest() {\r
b1b9997a 43 User testUser = new User("TestUser", "pass");\r
d6a2afc6
M
44 String goodMail = "grosm9@bfh.ch";\r
45 String wrongMail1 = "ioajfd.ch";\r
46 String wrongMail2 = "asjdfh@fds";\r
b1b9997a
ED
47\r
48 assertTrue(testUser.setMail(goodMail));\r
49 assertFalse(testUser.setMail(wrongMail1));\r
50 assertFalse(testUser.setMail(wrongMail2));\r
d6a2afc6 51 }\r
b1b9997a
ED
52\r
53 @Ignore\r
d6a2afc6 54 public void getMailTest() {\r
b1b9997a 55 User testUser = new User("TestUser", "pass");\r
d6a2afc6 56 String mail = "grosm9@bfh.ch";\r
b1b9997a
ED
57\r
58 testUser.setMail(mail);\r
59 assertEquals(mail, testUser.getMail());\r
7f912ebe
M
60 }\r
61\r
b1b9997a 62 @Ignore\r
8ceddb90 63 public void setAndGetNameTest() {\r
b1b9997a
ED
64 User testUser = new User("TestUser", "pass");\r
65 testUser.setName("Tester");\r
66 assertEquals("Tester",testUser.getName());\r
8ceddb90 67 }\r
b1b9997a
ED
68\r
69 @Ignore\r
61e1becd 70 public void setAndGetLastnameTest() {\r
b1b9997a
ED
71 User testUser = new User("TestUser", "pass");\r
72 testUser.setLastname("Dummy");\r
73 assertEquals("Dummy", testUser.getLastname());\r
8ceddb90 74 }\r
7f912ebe 75}\r