reverted imports/Nexus6 tests class
commit
08418fa66c
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,5 +1,5 @@
|
||||||
package domain;
|
package domain;
|
||||||
import utility.interfaces.RobotControl;
|
|
||||||
import utility.robot_exceptions.ExceptionStorage;
|
import utility.robot_exceptions.ExceptionStorage;
|
||||||
import utility.robot_exceptions.RobotException;
|
import utility.robot_exceptions.RobotException;
|
||||||
import utility.robot_exceptions.robotExceptions;
|
import utility.robot_exceptions.robotExceptions;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
package domain;
|
package domain;
|
||||||
|
|
||||||
public enum RobotType {
|
public enum RobotType {
|
||||||
C3PO("C3PO"), R2D2("R2D2"), Nexus6("Nexus6");
|
C3PO("C3PO"), R2D2("R2D2"), Nexus6("Nexus6");
|
||||||
private final String type;
|
private final String type;
|
||||||
|
|
|
@ -20,6 +20,7 @@ public class RobotException extends Exception{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
// länge auffüllen für ebene Liste
|
||||||
public String toString(){
|
public String toString(){
|
||||||
return getMessage(this.currentType, this.name);
|
return getMessage(this.currentType, this.name);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ package utility.robot_exceptions;
|
||||||
public enum robotExceptions {
|
public enum robotExceptions {
|
||||||
ILLEGALSTATE("ist in einem illegalen Zustand"),
|
ILLEGALSTATE("ist in einem illegalen Zustand"),
|
||||||
MAGICVALUE("Magic value"),
|
MAGICVALUE("Magic value"),
|
||||||
EMPTYARRAY("leer");
|
EMPTYARRAY("hat ein leeres Array bekommen.");
|
||||||
|
|
||||||
final String message;
|
final String message;
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ class C3POTest {
|
||||||
try{
|
try{
|
||||||
String solution = c3po.speak(new int[]{});
|
String solution = c3po.speak(new int[]{});
|
||||||
}catch(RobotException re){
|
}catch(RobotException re){
|
||||||
assertEquals(0, "r2d2 leer".compareTo(re.getMessage()));
|
assertEquals(0, "r2d2 hat ein leeres Array bekommen.".compareTo(re.getMessage()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,7 +151,7 @@ class C3POTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void arrayEmptyException(){
|
void arrayEmptyException(){
|
||||||
String expectedMessage = "Herbert leer";
|
String expectedMessage = "Herbert hat ein leeres Array bekommen.";
|
||||||
try{
|
try{
|
||||||
int[] solution = c3po.think(new int[0]);
|
int[] solution = c3po.think(new int[0]);
|
||||||
}catch(RobotException re){
|
}catch(RobotException re){
|
||||||
|
@ -166,7 +166,7 @@ class C3POTest {
|
||||||
}
|
}
|
||||||
@Test
|
@Test
|
||||||
void testExceptionHistory() {
|
void testExceptionHistory() {
|
||||||
String expectedMessage = "Herbert leer";
|
String expectedMessage = "Herbert hat ein leeres Array bekommen.";
|
||||||
try{
|
try{
|
||||||
int[] solution = c3po.think(new int[0]);
|
int[] solution = c3po.think(new int[0]);
|
||||||
}catch(RobotException re){
|
}catch(RobotException re){
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
package tests;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
|
class FactoryTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void robotListToCollection() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void getRobotList() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void buildNewRobot() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void getRobotOfList() {
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,11 +1,9 @@
|
||||||
package tests;
|
package tests;
|
||||||
|
|
||||||
import domain.R2D2;
|
import domain.R2D2;
|
||||||
import domain.RobotType;
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
import utility.robot_exceptions.RobotException;
|
import utility.robot_exceptions.RobotException;
|
||||||
import utility.robot_exceptions.RobotMagicValueException;
|
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
|
@ -48,7 +46,7 @@ class R2D2Test {
|
||||||
try{
|
try{
|
||||||
String solution = r2d2.speak(new int[]{});
|
String solution = r2d2.speak(new int[]{});
|
||||||
}catch(RobotException re){
|
}catch(RobotException re){
|
||||||
assertEquals(0, "r2d2 leer".compareTo(re.getMessage()));
|
assertEquals(0, "r2d2 hat ein leeres Array bekommen.".compareTo(re.getMessage()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue