?? testtextprimitive.java
字號:
package com.wiley.compBooks.EJwithUML.Base.HtmlPrimitives.ContentElements;import junit.framework.*;import com.wiley.compBooks.EJwithUML.Base.TestUtilities.*;import java.io.*;public class TestTextPrimitive extends TestCase{ private TestFileSet testFileSet; public TestTextPrimitive(String name) throws IOException { super(name); testFileSet = new TestFileSet("C:/EJwithUML2e/UnitTestResults/HtmlPrimitives/ContentElements/TextPrimitive/"); } public void testEmpty() throws IOException { StringBuffer buffer = new StringBuffer(); TextPrimitive text = new TextPrimitive(); text.buildContent(buffer); boolean match = testFileSet.fileMatchesGold("Empty.html", buffer.toString()); assertEquals("Empty", match, true); } public void testEmptyConstructor() throws IOException { StringBuffer buffer = new StringBuffer(); TextPrimitive text = new TextPrimitive(); text.addLineBreak(); text.addText("Hi there!"); text.addLineBreak(); text.addText("Bye now"); text.addLineBreak(); text.buildContent(buffer); boolean match = testFileSet.fileMatchesGold("EmptyConstructor.html", buffer.toString()); assertEquals("EmptyConstructor", match, true); } public void testInitialTextConstructor() throws IOException { StringBuffer buffer = new StringBuffer(); TextPrimitive text = new TextPrimitive("Hi there!"); text.addLineBreak(); text.addText("Bye for now."); text.addLineBreak(); text.buildContent(buffer); boolean match = testFileSet.fileMatchesGold("InitialTextConstructor.html", buffer.toString()); assertEquals("InitialTextConstructor", match, true); }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -