📄 knightoftheroundtabletest.java
字号:
package com.springinaction.chapter01.knight;import com.springinaction.chapter01.knight.HolyGrail;
import com.springinaction.chapter01.knight.HolyGrailQuest;
import com.springinaction.chapter01.knight.KnightOfTheRoundTable;
import com.springinaction.chapter01.knight.QuestException;
import junit.framework.TestCase;
public class KnightOfTheRoundTableTest extends TestCase {
public void testEmbarkOnQuest() {
KnightOfTheRoundTable knight = new KnightOfTheRoundTable("Bedivere");
knight.setQuest(new HolyGrailQuest());
try {
HolyGrail grail = (HolyGrail) knight.embarkOnQuest();
assertNotNull(grail);
assertTrue(grail.isHoly());
} catch (QuestException e) {
fail();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -