23 Commits

Author SHA1 Message Date
Adem Berber 432211464b Added Different Release Month Checker + Tests + Javadoc + Fixed Javadoc + Refactoring 3 years ago
Adem Berber a4ce780b4e Added Same Release Month Checker + Tests + Javadoc 3 years ago
Adem Berber cf04d5dc45 Fixed Missing Test 3 years ago
Jenkins 02018ccdfc Merge commit '66a8e380b06f8dff28e5871ab298598fb916b7f2' into HEAD 3 years ago
Maxim Volkov 66a8e380b0 Added: Better Test Coverage for the Birthday class 3 years ago
Maxim Volkov b3833f62b8 Added: Birthday Validation + Test 3 years ago
Maxim Volkov 8b877b0621 Refactoring: Minor Renaming in User class 3 years ago
Maxim Volkov 866807f244 Refactoring: Optimized Structure of Tests 3 years ago
Maxim Volkov 66dc3dea9c Added: Create register and check user data - Test 3 years ago
Maxim Volkov 012ad38d16 Added: Count Registered Users and Test 3 years ago
Maxim Volkov fa83071186 Added: Remove a registered user + Basic Test 3 years ago
Maxim Volkov 59ba7db3a5 Added: Nickname allready taken test 3 years ago
Maxim Volkov a5d54b0ea6 Added: Register Multiple Users Test 3 years ago
Maxim Volkov 8bc8925dfb Remove: Deprecated System Out Print 3 years ago
Maxim Volkov 08664de5b5 Refactoring: Rename Test for registering a user 3 years ago
Maxim Volkov edc3cd2c14 Added: Registering a User + Basic Test 3 years ago
Maxim Volkov 9061e3df65 Added: Customers class for managing Users, Test if a nickname is available 3 years ago
Maxim Volkov e7fe6b37ff Added: User class, basic attributes 3 years ago
Maxim Volkov 64fbd34031 Refactoring: Fixing Comments in Birthdate 3 years ago
Maxim Volkov b1cda58c66 Added: Change Date of Birthday 3 years ago
Maxim Volkov 7ae7650c2d Cleanup: Birthday class 3 years ago
Maxim Volkov e0f80b9ae7 Added: Birthdate class, basic Birthdate Test 3 years ago
Jenkins 09a92f0128 Merge commit '3511885503e57a6d55ed63b26197cc12c03f9a7f' into HEAD 3 years ago
  1. 59
      projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Birthdate.java
  2. 31
      projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Customers.java
  3. 117
      projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Games.java
  4. 41
      projjpn/src/main/java/de/hs_fulda/ciip/projjpn/User.java
  5. 63
      projjpn/src/test/java/de/hs_fulda/ciip/projjpn/BirthdateTest.java
  6. 162
      projjpn/src/test/java/de/hs_fulda/ciip/projjpn/CustomersTest.java
  7. 38
      projjpn/src/test/java/de/hs_fulda/ciip/projjpn/GamesTest.java
  8. 20
      projjpn/src/test/java/de/hs_fulda/ciip/projjpn/UserTest.java

59
projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Birthdate.java

@ -0,0 +1,59 @@
package de.hs_fulda.ciip.projjpn;
public class Birthdate {
private int day;
private int month;
private int year;
public Birthdate(int d, int m, int y) {
day = d;
month = m;
year = y;
}
public int getDay() {
return day;
}
public int getMonth() {
return month;
}
public int getYear() {
return year;
}
/**
* @return Date Format DD.MM.YYYY
*/
public String toString() {
return day + "." + month + "." + year;
}
/**
*
* @param d Day
* @param m Month
* @param y Year
*/
public void changeBirthdate(int d, int m, int y) {
day = d;
month = m;
year = y;
}
public boolean isValid(int DD, int MM, int YYYY) {
if (DD < 1 || DD > 31) {
return false;
}
if (MM < 1 || MM > 12) {
return false;
}
if (YYYY < 1990 || YYYY > 2022) {
return false;
}
return true;
}
}

31
projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Customers.java

@ -0,0 +1,31 @@
package de.hs_fulda.ciip.projjpn;
import java.util.HashMap;
public class Customers {
HashMap<String, User> pool = new HashMap<String, User>();
public boolean nickNameAvailable(String nickname) {
User u = pool.get(nickname);
if (null == u) {
return true;
}
return false;
}
public User registerUser(User user) {
return pool.putIfAbsent(user.nickName, user);
}
public User deleteUser(String userNickname) {
return pool.remove(userNickname);
}
public User getByNickname(String nickname) {
return pool.get(nickname);
}
public int getCountOfUsers() {
return pool.size();
}
}

117
projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Games.java

@ -42,8 +42,7 @@ public class Games {
Statement statement = connection.createStatement();
ResultSet resultSet = statement.executeQuery(query);
result += "Name, Console, Developer, Publisher EU, Publisher JP, Publisher NA, Genre, Release EU, Release JP, Release NA, Release AU, USK Rating, PEGI Rating, ESRB Rating, CERO Rating, ACB Rating, Players\n\n";
result += "Name, Console, Developer, Publisher EU, Publisher JP, Publisher NA, Genre, Release EU, Release JP, Release NA, Release AU, USK Rating, PEGI Rating, ESRB Rating, CERO Rating, ACB Rating, Players\n\n";
while (resultSet.next()) {
String gameName = resultSet.getString("Game_Name");
@ -82,17 +81,17 @@ public class Games {
String gamePlayers = resultSet.getString("Game_Players");
if (gamePegi != 0) {
result += gameName + ", " + gameConsole + ", " + gameDeveloper + ", " + gamePublisherEu
+ ", " + gamePublisherJp + ", " + gamePublisherNa + ", " + gameGenre + ", "
+ gameReleaseEuDots + ", " + gameReleaseJpDots + ", " + gameReleaseNaDots + ", "
+ gameReleaseAuDots + ", " + gameUsk + ", " + gamePegi + ", " + gameEsrb + ", " + gameCero
+ ", " + gameAcb + ", " + gamePlayers + "\n";
result += gameName + ", " + gameConsole + ", " + gameDeveloper + ", " + gamePublisherEu + ", "
+ gamePublisherJp + ", " + gamePublisherNa + ", " + gameGenre + ", " + gameReleaseEuDots
+ ", " + gameReleaseJpDots + ", " + gameReleaseNaDots + ", " + gameReleaseAuDots + ", "
+ gameUsk + ", " + gamePegi + ", " + gameEsrb + ", " + gameCero + ", " + gameAcb + ", "
+ gamePlayers + "\n";
} else {
result += gameName + ", " + gameConsole + ", " + gameDeveloper + ", " + gamePublisherEu
+ ", " + gamePublisherJp + ", " + gamePublisherNa + ", " + gameGenre + ", "
+ gameReleaseEuDots + ", " + gameReleaseJpDots + ", " + gameReleaseNaDots + ", "
+ gameReleaseAuDots + ", " + gameUsk + ", Unknown, " + gameEsrb + ", " + gameCero + ", "
+ gameAcb + ", " + gamePlayers + "\n";
result += gameName + ", " + gameConsole + ", " + gameDeveloper + ", " + gamePublisherEu + ", "
+ gamePublisherJp + ", " + gamePublisherNa + ", " + gameGenre + ", " + gameReleaseEuDots
+ ", " + gameReleaseJpDots + ", " + gameReleaseNaDots + ", " + gameReleaseAuDots + ", "
+ gameUsk + ", Unknown, " + gameEsrb + ", " + gameCero + ", " + gameAcb + ", " + gamePlayers
+ "\n";
}
}
@ -1333,6 +1332,100 @@ public class Games {
return result.substring(0, result.length() - 2);
}
/**
* Checks if the release months are all the same across Europe, Japan, North
* America and Australia.
*
* @return Prints the games which have the same release month.
*/
public String checkAllSameReleaseMonth() {
String result = "";
String query = "SELECT Game_Name, Game_Release_EU, Game_Release_JP, Game_Release_NA, Game_Release_AU FROM Games";
try {
Connection connection = DriverManager.getConnection(databaseURL);
Statement statement = connection.createStatement();
ResultSet resultSet = statement.executeQuery(query);
while (resultSet.next()) {
String gameName = resultSet.getString("Game_Name");
String gameReleaseEu = resultSet.getString("Game_Release_EU");
String gameReleaseJp = resultSet.getString("Game_Release_JP");
String gameReleaseNa = resultSet.getString("Game_Release_NA");
String gameReleaseAu = resultSet.getString("Game_Release_AU");
if (gameReleaseAu == null) {
} else {
if (gameReleaseEu.substring(5, 7).equals(gameReleaseJp.substring(5, 7))
&& gameReleaseJp.substring(5, 7).equals(gameReleaseNa.substring(5, 7))
&& gameReleaseEu.substring(5, 7).equals(gameReleaseNa.substring(5, 7))
&& gameReleaseAu.substring(5, 7).equals(gameReleaseEu.substring(5, 7))
&& gameReleaseAu.substring(5, 7).equals(gameReleaseJp.substring(5, 7))
&& gameReleaseAu.substring(5, 7).equals(gameReleaseNa.substring(5, 7))) {
result += gameName + ", ";
}
}
}
statement.close();
connection.close();
} catch (SQLException e) {
e.printStackTrace();
}
return result.substring(0, result.length() - 2);
}
/**
* Checks if the release months are not all the same across Europe, Japan, North
* America and Australia.
*
* @return Prints the games which do not have the same release month.
*/
public String checkAllDifferentReleaseMonth() {
String result = "";
String query = "SELECT Game_Name, Game_Release_EU, Game_Release_JP, Game_Release_NA, Game_Release_AU FROM Games";
try {
Connection connection = DriverManager.getConnection(databaseURL);
Statement statement = connection.createStatement();
ResultSet resultSet = statement.executeQuery(query);
while (resultSet.next()) {
String gameName = resultSet.getString("Game_Name");
String gameReleaseEu = resultSet.getString("Game_Release_EU");
String gameReleaseJp = resultSet.getString("Game_Release_JP");
String gameReleaseNa = resultSet.getString("Game_Release_NA");
String gameReleaseAu = resultSet.getString("Game_Release_AU");
if (gameReleaseAu == null) {
result += gameName + ", ";
} else {
if (!gameReleaseEu.substring(5, 7).equals(gameReleaseJp.substring(5, 7))
|| !gameReleaseJp.substring(5, 7).equals(gameReleaseNa.substring(5, 7))
|| !gameReleaseEu.substring(5, 7).equals(gameReleaseNa.substring(5, 7))
|| !gameReleaseAu.substring(5, 7).equals(gameReleaseEu.substring(5, 7))
|| !gameReleaseAu.substring(5, 7).equals(gameReleaseJp.substring(5, 7))
|| !gameReleaseAu.substring(5, 7).equals(gameReleaseNa.substring(5, 7))) {
result += gameName + ", ";
}
}
}
statement.close();
connection.close();
} catch (SQLException e) {
e.printStackTrace();
}
return result.substring(0, result.length() - 2);
}
/**
* Checks if the game is compatible with one player or more.
*

41
projjpn/src/main/java/de/hs_fulda/ciip/projjpn/User.java

@ -0,0 +1,41 @@
package de.hs_fulda.ciip.projjpn;
public class User {
String firstName;
String lastName;
String nickName;
String eMail;
Birthdate birthdate;
public User(String firstName,
String lastName,
String nickName,
String eMail,
Birthdate birthdate) {
this.firstName = firstName;
this.lastName = lastName;
this.nickName = nickName;
this.eMail = eMail;
this.birthdate = birthdate;
}
public User(String nickName) {
this.nickName = nickName;
}
public String getFirstName() {
return firstName;
}
public String getLastName() {
return lastName;
}
public String getNickName() {
return nickName;
}
public String getEMail() {
return eMail;
}
public Birthdate getBirthdate() {
return birthdate;
}
}

63
projjpn/src/test/java/de/hs_fulda/ciip/projjpn/BirthdateTest.java

@ -0,0 +1,63 @@
package de.hs_fulda.ciip.projjpn;
import junit.framework.TestCase;
public class BirthdateTest extends TestCase {
public void testToString() {
// Given
Birthdate b = new Birthdate(1, 1, 2000);
// When
String expectedDate = "1.1.2000";
// Then
assertEquals(expectedDate, b.toString());
}
public void test_changeBirthdate() {
// Given
Birthdate b = new Birthdate(1, 1, 2000);
// Change Birthdate
b.changeBirthdate(2, 3, 2001);
// When
int expectedDay = 2;
int expectedMonth = 3;
int expectedYear = 2001;
// Then
assertEquals(2, b.getDay());
assertEquals(3, b.getMonth());
assertEquals(2001, b.getYear());
}
public void test_rejectInvalidBirthday() {
Birthdate birthdate = new Birthdate(0, 0, 0);
boolean expectedResult = false;
boolean gotResult = birthdate.isValid(0, 0, 0);
assertEquals(expectedResult, gotResult);
gotResult = birthdate.isValid(32, 13, 1990);
assertEquals(expectedResult, gotResult);
gotResult = birthdate.isValid(31, 0, 1980);
assertEquals(expectedResult, gotResult);
gotResult = birthdate.isValid(31, 13, 1980);
assertEquals(expectedResult, gotResult);
gotResult = birthdate.isValid(1, 1, 3000);
assertEquals(expectedResult, gotResult);
gotResult = birthdate.isValid(1, 1, 1900);
assertEquals(expectedResult, gotResult);
expectedResult = true;
gotResult = birthdate.isValid(1, 5, 2020);
assertEquals(expectedResult, gotResult);
}
}

162
projjpn/src/test/java/de/hs_fulda/ciip/projjpn/CustomersTest.java

@ -0,0 +1,162 @@
package de.hs_fulda.ciip.projjpn;
import junit.framework.TestCase;
public class CustomersTest extends TestCase {
public void test_nicknameIsFree() {
// Given
Customers customers = new Customers();
String availableNickname = "beastMaster64";
// When
boolean nicknameIsAvailable = customers.nickNameAvailable(availableNickname);
// Then
assertTrue(nicknameIsAvailable);
}
public void test_nicknameIsTaken() {
// Given
Customers customers = new Customers();
String availableNickname = "beastMaster64";
String takenNickname = "beastMaster64";
User userToRegister = new User(availableNickname);
customers.registerUser(userToRegister);
// When
boolean nicknameIsTaken = customers.nickNameAvailable(availableNickname);
// Then
assertFalse(nicknameIsTaken);
}
public void test_registerSingleUser() {
// Given
Customers customers = new Customers();
String expectedNickNameInput = "Mougli";
User expectedNewUser = new User(expectedNickNameInput);
// Add a user
customers.registerUser(expectedNewUser);
// Get the expected User
User expectedUser = customers.getByNickname(expectedNickNameInput);
//
assertNotNull(expectedNewUser);
String expectedNickNameGotBack = expectedUser.nickName;
// When
boolean userRegistered = expectedNickNameGotBack.equals(expectedNickNameInput);
// Then
assertTrue(userRegistered);
}
/**
* Register multiple Users and then search for them in the same order.
*/
public void test_registerMultipleUsers() {
// Given
Customers customers = new Customers();
String[] expectedNickNamesInput = {"Mougli", "Tarkan", "beastMaster64", "BlaBlaPew", "MuchDoge_321"};
User[] expectedNewUsers = new User[expectedNickNamesInput.length];
for (int i = 0; i < expectedNickNamesInput.length; i++) {
// Create user
expectedNewUsers[i] = new User(expectedNickNamesInput[i]);
// Add user
customers.registerUser(expectedNewUsers[i]);
}
// Get the expected Users
User foundUser;
String expectedNickNameGotBack;
boolean userRegistered;
for (int i = 0; i < expectedNickNamesInput.length; i++) {
// Get user
foundUser = customers.getByNickname(expectedNickNamesInput[i]);
assertNotNull(foundUser);
// When
expectedNickNameGotBack = foundUser.nickName;
userRegistered = expectedNickNameGotBack.equals(expectedNickNamesInput[i]);
// Then
assertTrue(userRegistered);
}
}
public void test_removeRegisteredUser() {
// Given
Customers customers = new Customers();
String userToRemove = "beastMaster64";
User userToRegister = new User("beastMaster64");
customers.registerUser(userToRegister);
// When
boolean userExists = customers.nickNameAvailable(userToRemove);
assertFalse(userExists);
// Then
User removedUser = customers.deleteUser(userToRemove);
assertEquals(userToRemove, removedUser.nickName);
}
public void test_registerAndCountUsers() {
// Given
Customers customers = new Customers();
int expectedRegisteredUsers = 20;
int actualRegisteredUsers = -1;
String nickname;
// Prepare
for(int i = 0, j = 1; i < expectedRegisteredUsers; i++, j++) {
nickname = "beastMaster_" + j;
customers.registerUser(new User(nickname));
}
actualRegisteredUsers = customers.getCountOfUsers();
assertEquals(expectedRegisteredUsers, actualRegisteredUsers);
}
public void test_createRegisterAndCheckUserData() {
// Given
Customers customers = new Customers();
String firstName = "Mia";
String lastName = "Muster";
String nickName = "harley";
String eMail = "mia@muster.de";
Birthdate birthdate = new Birthdate(30, 12, 1997);
User userToCheck = new User(firstName, lastName, nickName, eMail, birthdate);
// Register User
customers.registerUser(userToCheck);
User gotUser = customers.getByNickname(nickName);
assertNotNull(gotUser);
// When
boolean correctFirstName = "Mia".equals(gotUser.getFirstName());
boolean correctLastName = "Muster".equals(gotUser.getLastName());
boolean correctNickName = "harley".equals(gotUser.getNickName());
boolean correctEMail = "mia@muster.de".equals(gotUser.getEMail());
boolean correctBirthdate = birthdate.toString().equals(gotUser.birthdate.toString());
// Then
assertTrue(correctFirstName);
assertTrue(correctLastName);
assertTrue(correctNickName);
assertTrue(correctEMail);
assertTrue(correctBirthdate);
}
}

38
projjpn/src/test/java/de/hs_fulda/ciip/projjpn/GamesTest.java

@ -192,6 +192,20 @@ public class GamesTest extends TestCase {
assertEquals(expected, actual);
}
public void test_checkAllSameReleaseMonth() {
Games testObject = new Games();
String expected = "Astral Chain, Fire Emblem: Three Houses, Triangle Strategy, Super Smash Bros. Ultimate, AI: The Somnium Files";
String actual = testObject.checkAllSameReleaseMonth();
assertEquals(expected, actual);
}
public void test_checkAllDifferentReleaseMonth() {
Games testObject = new Games();
String expected = "Persona 5 Royal, Ratchet & Clank, Rhythm Paradise, Yakuza: Dead Souls, Jet Set Radio Future, Breakdown, Persona 3 Portable, Tomodachi Life, Beautiful Katamari, Atelier Totori Plus, Crash Bandicoot N. Sane Trilogy";
String actual = testObject.checkAllDifferentReleaseMonth();
assertEquals(expected, actual);
}
public void test_checkOnePlayer() {
Games testObject = new Games();
String expected = "Persona 5 Royal, Ratchet & Clank, Astral Chain, Fire Emblem: Three Houses, Triangle Strategy, Rhythm Paradise, Super Smash Bros. Ultimate, Yakuza: Dead Souls, Jet Set Radio Future, Breakdown, AI: The Somnium Files, Persona 3 Portable, Tomodachi Life, Beautiful Katamari, Atelier Totori Plus, Crash Bandicoot N. Sane Trilogy";
@ -401,4 +415,28 @@ public class GamesTest extends TestCase {
String actual = testObject.checkAcbReighteen();
assertEquals(expected, actual);
}
public void test_printTable() {
Games testObject = new Games();
String expected = "Name, Console, Developer, Publisher EU, Publisher JP, Publisher NA, Genre, Release EU, Release JP, Release NA, Release AU, USK Rating, PEGI Rating, ESRB Rating, CERO Rating, ACB Rating, Players\n"
+ "\n"
+ "Persona 5 Royal, PlayStation 4, Atlus, Sega, Atlus, Atlus, JRPG, 31.03.2020, 31.10.2019, 31.03.2020, 31.03.2020, 16, 16, M, C, MA 15+, 1\n"
+ "Ratchet & Clank, Multiplatform, Insomniac Games, Sony Computer Entertainment, Sony Computer Entertainment, Sony Computer Entertainment, Action-Adventure, 08.11.2002, 03.12.2002, 04.11.2002, 08.11.2002, 6, 3, T, A, PG, 1\n"
+ "Astral Chain, Nintendo Switch, Platinum Games, Nintendo, Nintendo, Nintendo, Action-Adventure, 30.08.2019, 30.08.2019, 30.08.2019, 30.08.2019, 16, 16, T, C, M, 1-2\n"
+ "Fire Emblem: Three Houses, Nintendo Switch, Intelligent Systems, Nintendo, Nintendo, Nintendo, Tactical role-playing, 26.07.2019, 26.07.2019, 26.07.2019, 26.07.2019, 12, 12, T, B, M, 1\n"
+ "Triangle Strategy, Nintendo Switch, Artdink, Nintendo, Square Enix, Nintendo, Strategy, 04.03.2022, 04.03.2022, 04.03.2022, 04.03.2022, 12, 12, T, C, M, 1\n"
+ "Rhythm Paradise, Nintendo DS, Nintendo SPD, Nintendo, Nintendo, Nintendo, Rhythm, 01.05.2009, 31.07.2008, 05.04.2009, 04.06.2009, 0, 3, E, A, G, 1\n"
+ "Super Smash Bros. Ultimate, Nintendo Switch, Sora Ltd., Nintendo, Nintendo, Nintendo, Fighting, 07.12.2018, 07.12.2018, 07.12.2018, 07.12.2018, 12, 12, E10+, A, PG, 1-8\n"
+ "Yakuza: Dead Souls, PlayStation 3, Ryu Ga Gotoku Studio, Sega, Sega, Sega, Survival Horror, 16.03.2012, 09.06.2011, 13.03.2012, 15.03.2012, 18, 18, M, D, MA 15+, 1\n"
+ "Jet Set Radio Future, Xbox, Sega Sports R&D, Sega, Sega, Sega, Action, 14.03.2002, 22.02.2002, 25.02.2002, 14.03.2002, 12, Unknown, T, A, M, 1-4\n"
+ "Breakdown, Xbox, Namco, Electronic Arts, Namco, Namco, Action-Adventure, 18.06.2004, 29.01.2004, 16.03.2004, Unknown, 16, 18, M, C, MA 15+, 1\n"
+ "AI: The Somnium Files, Multiplatform, Spike Chunsoft, Numskull Games, Spike Chunsoft, Spike Chunsoft, Adventure, 20.09.2019, 19.09.2019, 17.09.2019, 20.09.2019, 16, 18, M, Z, MA 15+, 1\n"
+ "Persona 3 Portable, PlayStation Portable, Atlus, Ghostlight, Atlus, Atlus, RPG, 29.04.2011, 01.11.2009, 06.07.2010, 16.11.2011, 12, 12, M, B, MA 15+, 1\n"
+ "Tomodachi Life, Nintendo 3DS, Nintendo SPD, Nintendo, Nintendo, Nintendo, Life Simulation, 06.06.2014, 18.04.2013, 06.06.2014, 07.06.2014, 0, 3, E, A, PG, 1\n"
+ "Beautiful Katamari, Xbox 360, Bandai Namco Games, Bandai Namco Games, Bandai Namco Games, Bandai Namco Games, Puzzle, 29.02.2008, 16.10.2007, 18.10.2007, 07.03.2008, 0, 3, E, A, G, 1\n"
+ "Atelier Totori Plus, PlayStation Vita, Gust Co. Ltd., Tecmo Koei Europe, Gust Co. Ltd., Tecmo Koei America, RPG, 20.03.2013, 29.11.2012, 19.03.2013, Unknown, 6, 12, T, B, R 18+, 1\n"
+ "Crash Bandicoot N. Sane Trilogy, Multiplatform, Vicarious Visions, Activision, Activision, Activision, Platformer, 30.06.2017, 03.08.2017, 30.06.2017, 30.06.2017, 6, 7, E10+, A, PG, 1";
String actual = testObject.printTable();
assertEquals(expected, actual);
}
}

20
projjpn/src/test/java/de/hs_fulda/ciip/projjpn/UserTest.java

@ -0,0 +1,20 @@
package de.hs_fulda.ciip.projjpn;
import junit.framework.TestCase;
public class UserTest extends TestCase {
public void test_initAndGetBirthdayOfUser() {
// Given
Customers customers = new Customers();
String firstName = "Mia";
String lastName = "Muster";
String nickName = "harley";
String eMail = "mia@muster.de";
int DD = 30, MM = 12, YYYY = 1997;
String expectedBirthdate = new Birthdate(DD, MM, YYYY).toString();
User userToCheck = new User(firstName, lastName, nickName, eMail, new Birthdate(DD, MM, YYYY));
String gotBirthdate = userToCheck.getBirthdate().toString();
boolean gotExpectedBirthdayBack = gotBirthdate.equals(expectedBirthdate);
}
}
Loading…
Cancel
Save