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
917b3554 15import org.junit.Test;\r
7f912ebe
M
16\r
17public class UserTest {\r
7f912ebe 18\r
917b3554 19 @Test\r
d6a2afc6 20 public void createUserTest() {\r
b1b9997a
ED
21 User testUser = new User("TestUser", "pass");\r
22 assertEquals("TestUser", testUser.getUserName());\r
7f912ebe 23 }\r
b1b9997a
ED
24\r
25 @Ignore\r
d6a2afc6 26 public void checkPasswordTest() {\r
b1b9997a
ED
27 User testUser = new User("TestUser", "pass");\r
28 assertTrue(testUser.checkPassword("pass"));\r
29 assertFalse(testUser.checkPassword("notmypass"));\r
d6a2afc6 30 }\r
b1b9997a
ED
31\r
32 @Ignore\r
d6a2afc6 33 public void changePasswordTest() {\r
b1b9997a
ED
34 User testUser = new User("TestUser", "pass");\r
35 assertTrue(testUser.checkPassword("pass"));\r
36 testUser.changePassword("newpass");\r
37 assertTrue(testUser.checkPassword("newpass"));\r
38 assertFalse(testUser.checkPassword("pass"));\r
39 assertFalse(testUser.checkPassword("notmypass"));\r
d6a2afc6 40 }\r
b1b9997a
ED
41\r
42 @Ignore\r
d6a2afc6 43 public void setMailTest() {\r
b1b9997a 44 User testUser = new User("TestUser", "pass");\r
d6a2afc6
M
45 String goodMail = "grosm9@bfh.ch";\r
46 String wrongMail1 = "ioajfd.ch";\r
47 String wrongMail2 = "asjdfh@fds";\r
b1b9997a
ED
48\r
49 assertTrue(testUser.setMail(goodMail));\r
50 assertFalse(testUser.setMail(wrongMail1));\r
51 assertFalse(testUser.setMail(wrongMail2));\r
d6a2afc6 52 }\r
b1b9997a
ED
53\r
54 @Ignore\r
d6a2afc6 55 public void getMailTest() {\r
b1b9997a 56 User testUser = new User("TestUser", "pass");\r
d6a2afc6 57 String mail = "grosm9@bfh.ch";\r
b1b9997a
ED
58\r
59 testUser.setMail(mail);\r
60 assertEquals(mail, testUser.getMail());\r
7f912ebe
M
61 }\r
62\r
b1b9997a 63 @Ignore\r
8ceddb90 64 public void setAndGetNameTest() {\r
b1b9997a
ED
65 User testUser = new User("TestUser", "pass");\r
66 testUser.setName("Tester");\r
67 assertEquals("Tester",testUser.getName());\r
8ceddb90 68 }\r
b1b9997a
ED
69\r
70 @Ignore\r
61e1becd 71 public void setAndGetLastnameTest() {\r
b1b9997a
ED
72 User testUser = new User("TestUser", "pass");\r
73 testUser.setLastname("Dummy");\r
74 assertEquals("Dummy", testUser.getLastname());\r
8ceddb90 75 }\r
7f912ebe 76}\r