📄 lefttest.java
字号:
package cn.nasa;
import junit.framework.TestCase;
public class LeftTest extends TestCase {
private Direction E,S,W,N;
private Coordinate coordinate;
private Left left;
protected void setUp() throws Exception {
super.setUp();
left=new Left();
N=new Direction();
E=new Direction();
W=new Direction();
S=new Direction();
N.setLeft(W);
W.setLeft(S);
S.setLeft(E);
E.setLeft(N);
coordinate=new Coordinate(2,3);
}
protected void tearDown() throws Exception {
super.tearDown();
}
public void testExec() {
left.setdirection(N);
assertEquals(W, left.exec());
assertEquals(S, left.exec());
assertEquals(E, left.exec());
assertEquals(N, left.exec());
}
// public void testSetcoordinate() {
// left.setcoordinate(coordinate);
// }
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -