Browse Source

Refactored Code and Class

dev
Adem Berber 3 years ago
parent
commit
bb01756f68
  1. 22
      projjpn/src/main/java/de/hs_fulda/ciip/projjpn/Games.java
  2. 23
      projjpn/src/test/java/de/hs_fulda/ciip/projjpn/GamesTest.java

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

@ -1324,7 +1324,7 @@ public class Games {
return result.substring(0, result.length() - 2); return result.substring(0, result.length() - 2);
} }
public String checkUskZero() { public String checkUskZero() {
String result = ""; String result = "";
String query = "SELECT Game_Name, Game_USK_Rating FROM Games"; String query = "SELECT Game_Name, Game_USK_Rating FROM Games";
@ -1353,7 +1353,7 @@ public class Games {
return result.substring(0, result.length() - 2); return result.substring(0, result.length() - 2);
} }
public String checkUskSix() { public String checkUskSix() {
String result = ""; String result = "";
String query = "SELECT Game_Name, Game_USK_Rating FROM Games"; String query = "SELECT Game_Name, Game_USK_Rating FROM Games";
@ -1382,7 +1382,7 @@ public class Games {
return result.substring(0, result.length() - 2); return result.substring(0, result.length() - 2);
} }
public String checkUskTwelve() { public String checkUskTwelve() {
String result = ""; String result = "";
String query = "SELECT Game_Name, Game_USK_Rating FROM Games"; String query = "SELECT Game_Name, Game_USK_Rating FROM Games";
@ -1411,7 +1411,7 @@ public class Games {
return result.substring(0, result.length() - 2); return result.substring(0, result.length() - 2);
} }
public String checkUskSixteen() { public String checkUskSixteen() {
String result = ""; String result = "";
String query = "SELECT Game_Name, Game_USK_Rating FROM Games"; String query = "SELECT Game_Name, Game_USK_Rating FROM Games";
@ -1440,7 +1440,7 @@ public class Games {
return result.substring(0, result.length() - 2); return result.substring(0, result.length() - 2);
} }
public String checkUskEighteen() { public String checkUskEighteen() {
String result = ""; String result = "";
String query = "SELECT Game_Name, Game_USK_Rating FROM Games"; String query = "SELECT Game_Name, Game_USK_Rating FROM Games";
@ -1469,7 +1469,7 @@ public class Games {
return result.substring(0, result.length() - 2); return result.substring(0, result.length() - 2);
} }
public String checkPegiThree() { public String checkPegiThree() {
String result = ""; String result = "";
String query = "SELECT Game_Name, Game_PEGI_Rating FROM Games"; String query = "SELECT Game_Name, Game_PEGI_Rating FROM Games";
@ -1498,7 +1498,7 @@ public class Games {
return result.substring(0, result.length() - 2); return result.substring(0, result.length() - 2);
} }
public String checkPegiSeven() { public String checkPegiSeven() {
String result = ""; String result = "";
String query = "SELECT Game_Name, Game_PEGI_Rating FROM Games"; String query = "SELECT Game_Name, Game_PEGI_Rating FROM Games";
@ -1527,7 +1527,7 @@ public class Games {
return result.substring(0, result.length() - 2); return result.substring(0, result.length() - 2);
} }
public String checkPegiTwelve() { public String checkPegiTwelve() {
String result = ""; String result = "";
String query = "SELECT Game_Name, Game_PEGI_Rating FROM Games"; String query = "SELECT Game_Name, Game_PEGI_Rating FROM Games";
@ -1556,7 +1556,7 @@ public class Games {
return result.substring(0, result.length() - 2); return result.substring(0, result.length() - 2);
} }
public String checkPegiSixteen() { public String checkPegiSixteen() {
String result = ""; String result = "";
String query = "SELECT Game_Name, Game_PEGI_Rating FROM Games"; String query = "SELECT Game_Name, Game_PEGI_Rating FROM Games";
@ -1585,7 +1585,7 @@ public class Games {
return result.substring(0, result.length() - 2); return result.substring(0, result.length() - 2);
} }
public String checkPegiEighteen() { public String checkPegiEighteen() {
String result = ""; String result = "";
String query = "SELECT Game_Name, Game_PEGI_Rating FROM Games"; String query = "SELECT Game_Name, Game_PEGI_Rating FROM Games";
@ -1614,7 +1614,7 @@ public class Games {
return result.substring(0, result.length() - 2); return result.substring(0, result.length() - 2);
} }
public String checkPegiUnknown() { public String checkPegiUnknown() {
String result = ""; String result = "";
String query = "SELECT Game_Name, Game_PEGI_Rating FROM Games"; String query = "SELECT Game_Name, Game_PEGI_Rating FROM Games";

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

@ -226,77 +226,77 @@ public class GamesTest extends TestCase {
String actual = testObject.checkOnePlayerOnly(); String actual = testObject.checkOnePlayerOnly();
assertEquals(expected, actual); assertEquals(expected, actual);
} }
public void test_checkUskZero() { public void test_checkUskZero() {
Games testObject = new Games(); Games testObject = new Games();
String expected = "Rhythm Paradise, Tomodachi Life, Beautiful Katamari"; String expected = "Rhythm Paradise, Tomodachi Life, Beautiful Katamari";
String actual = testObject.checkUskZero(); String actual = testObject.checkUskZero();
assertEquals(expected, actual); assertEquals(expected, actual);
} }
public void test_checkUskSix() { public void test_checkUskSix() {
Games testObject = new Games(); Games testObject = new Games();
String expected = "Ratchet & Clank, Atelier Totori Plus, Crash Bandicoot N. Sane Trilogy"; String expected = "Ratchet & Clank, Atelier Totori Plus, Crash Bandicoot N. Sane Trilogy";
String actual = testObject.checkUskSix(); String actual = testObject.checkUskSix();
assertEquals(expected, actual); assertEquals(expected, actual);
} }
public void test_checkUskTwelve() { public void test_checkUskTwelve() {
Games testObject = new Games(); Games testObject = new Games();
String expected = "Fire Emblem: Three Houses, Triangle Strategy, Super Smash Bros. Ultimate, Jet Set Radio Future, Persona 3 Portable"; String expected = "Fire Emblem: Three Houses, Triangle Strategy, Super Smash Bros. Ultimate, Jet Set Radio Future, Persona 3 Portable";
String actual = testObject.checkUskTwelve(); String actual = testObject.checkUskTwelve();
assertEquals(expected, actual); assertEquals(expected, actual);
} }
public void test_checkUskSixteen() { public void test_checkUskSixteen() {
Games testObject = new Games(); Games testObject = new Games();
String expected = "Persona 5 Royal, Astral Chain, Breakdown, AI: The Somnium Files"; String expected = "Persona 5 Royal, Astral Chain, Breakdown, AI: The Somnium Files";
String actual = testObject.checkUskSixteen(); String actual = testObject.checkUskSixteen();
assertEquals(expected, actual); assertEquals(expected, actual);
} }
public void test_checkUskEighteen() { public void test_checkUskEighteen() {
Games testObject = new Games(); Games testObject = new Games();
String expected = "Yakuza: Dead Souls"; String expected = "Yakuza: Dead Souls";
String actual = testObject.checkUskEighteen(); String actual = testObject.checkUskEighteen();
assertEquals(expected, actual); assertEquals(expected, actual);
} }
public void test_checkPegiThree() { public void test_checkPegiThree() {
Games testObject = new Games(); Games testObject = new Games();
String expected = "Ratchet & Clank, Rhythm Paradise, Tomodachi Life, Beautiful Katamari"; String expected = "Ratchet & Clank, Rhythm Paradise, Tomodachi Life, Beautiful Katamari";
String actual = testObject.checkPegiThree(); String actual = testObject.checkPegiThree();
assertEquals(expected, actual); assertEquals(expected, actual);
} }
public void test_checkPegiSeven() { public void test_checkPegiSeven() {
Games testObject = new Games(); Games testObject = new Games();
String expected = "Crash Bandicoot N. Sane Trilogy"; String expected = "Crash Bandicoot N. Sane Trilogy";
String actual = testObject.checkPegiSeven(); String actual = testObject.checkPegiSeven();
assertEquals(expected, actual); assertEquals(expected, actual);
} }
public void test_checkPegiTwelve() { public void test_checkPegiTwelve() {
Games testObject = new Games(); Games testObject = new Games();
String expected = "Fire Emblem: Three Houses, Triangle Strategy, Super Smash Bros. Ultimate, Persona 3 Portable, Atelier Totori Plus"; String expected = "Fire Emblem: Three Houses, Triangle Strategy, Super Smash Bros. Ultimate, Persona 3 Portable, Atelier Totori Plus";
String actual = testObject.checkPegiTwelve(); String actual = testObject.checkPegiTwelve();
assertEquals(expected, actual); assertEquals(expected, actual);
} }
public void test_checkPegiSixteen() { public void test_checkPegiSixteen() {
Games testObject = new Games(); Games testObject = new Games();
String expected = "Persona 5 Royal, Astral Chain"; String expected = "Persona 5 Royal, Astral Chain";
String actual = testObject.checkPegiSixteen(); String actual = testObject.checkPegiSixteen();
assertEquals(expected, actual); assertEquals(expected, actual);
} }
public void test_checkPegiEighteen() { public void test_checkPegiEighteen() {
Games testObject = new Games(); Games testObject = new Games();
String expected = "Yakuza: Dead Souls, Breakdown, AI: The Somnium Files"; String expected = "Yakuza: Dead Souls, Breakdown, AI: The Somnium Files";
String actual = testObject.checkPegiEighteen(); String actual = testObject.checkPegiEighteen();
assertEquals(expected, actual); assertEquals(expected, actual);
} }
public void test_checkPegiUnknown() { public void test_checkPegiUnknown() {
Games testObject = new Games(); Games testObject = new Games();
String expected = "Jet Set Radio Future"; String expected = "Jet Set Radio Future";
@ -304,4 +304,3 @@ public class GamesTest extends TestCase {
assertEquals(expected, actual); assertEquals(expected, actual);
} }
} }
Loading…
Cancel
Save