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