⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testselectionprimitive.java

📁 考勤管理系统源码
💻 JAVA
字号:
package com.wiley.compBooks.EJwithUML.Base.HtmlPrimitives.FormPrimitives;import junit.framework.TestCase;import com.wiley.compBooks.EJwithUML.Base.TestUtilities.*;import com.wiley.compBooks.EJwithUML.Base.HtmlPrimitives.ContentElements.*;import java.io.*;public class TestSelectionPrimitive extends TestCase{  private TestFileSet testFileSet;  public TestSelectionPrimitive(String name) throws IOException  {    super(name);    testFileSet = new TestFileSet("C:/EJwithUML2e/UnitTestResults/HtmlPrimitives/FormPrimitives/SelectionPrimitive/");  }  public static void main(String[] args)  {    junit.textui.TestRunner.run(TestSelectionPrimitive.class);  }  public void testEmptySelection() throws IOException  {    StringBuffer buffer = new StringBuffer();    SelectionPrimitive selection = new SelectionPrimitive("favoriteFlavor");    selection.buildContent(buffer);    boolean match = testFileSet.fileMatchesGold("EmptySelection.html", buffer.toString());    assertEquals("EmptySelection", match, true);  }  public void testSingleOption() throws IOException  {    StringBuffer buffer = new StringBuffer();    SelectionPrimitive selection = new SelectionPrimitive("favoriteFlavor");    selection.addValue("Vanilla Creme", "vanilla_creme", false);    selection.buildContent(buffer);    boolean match = testFileSet.fileMatchesGold("SingleOption.html", buffer.toString());    assertEquals("SingleOption", match, true);  }  public void testSingleOptionSelected() throws IOException  {    StringBuffer buffer = new StringBuffer();    SelectionPrimitive selection = new SelectionPrimitive("favoriteFlavor");    selection.addValue("Vanilla Creme", "vanilla_creme", true);    selection.buildContent(buffer);    boolean match = testFileSet.fileMatchesGold("SingleOptionSelected.html", buffer.toString());    assertEquals("SingleOptionSelected", match, true);  }  public void testManyOptions() throws IOException  {    StringBuffer buffer = new StringBuffer();    SelectionPrimitive selection = new SelectionPrimitive("favoriteFlavor");    selection.addValue("Vanilla Creme", "vanilla_creme", false);    selection.addValue("Fudge Ripple", "fudge_ripple", false);    selection.addValue("Strawberry", "strawberry", false);    selection.buildContent(buffer);    boolean match = testFileSet.fileMatchesGold("ManyOptions.html", buffer.toString());    assertEquals("ManyOptions", match, true);  }  public void testManyOptionsOneSelected() throws IOException  {    StringBuffer buffer = new StringBuffer();    SelectionPrimitive selection = new SelectionPrimitive("favoriteFlavor");    selection.addValue("Vanilla Creme", "vanilla_creme", false);    selection.addValue("Fudge Ripple", "fudge_ripple", true);    selection.addValue("Strawberry", "strawberry", false);    selection.buildContent(buffer);    boolean match = testFileSet.fileMatchesGold("ManyOptionsOneSelected.html", buffer.toString());    assertEquals("ManyOptionsOneSelected", match, true);  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -