📄 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 + -