testtextprimitive.java

来自「考勤管理系统源码」· Java 代码 · 共 58 行

JAVA
58
字号
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 + =
减小字号Ctrl + -
显示快捷键?