The test class contains two tests: one to authenticate a valid user and another to authenticate an invalid user.
这个测试类包含两个测试:一个是鉴定一个无效用户,另一个是鉴定一个有效的用户。
Now that I have my test class defined I can start developing (and testing) the application.
定义了测试类后,就可以开始开发(并测试)这个应用程序了。
As long as all the test cases pass, I add the new unit test class to my unit test automation library, which gets run on every build.
只要通过所有的测试用例,我就将向单元测试自动库添加新的单元测试类,在每次构建时运行。
The test class represents the usual unit of test execution that occurs while you are developing, and so we should consider carefully how many tests to include in any one class.
测试类表示在开发时发生的测试执行的常见单元,所以我们应仔细考虑任何一个类中包括了多少个测试。
The execution model is a bit strange: The test class is reinstantiated every time a test method is executed.
执行模型有点奇怪:每次执行一个测试方法的时候,都要重新实例化测试类。
Finally, the two lines at the bottom allow you to run the tests within this test class by simply running this module.
最后的两行负责在这个测试类内部运行测试,方法是直接运行该模块即可。
Listing 4 shows the test class, again showing the main sections of the test.
清单4显示了测试类,还显示了测试的主要部分。
For instance, some samples I've seen have adopted a convention where the test class USES the same names for its test methods as the class being tested does.
例如,我介绍的一些例子采用的约定是,测试类对其测试方法使用与被测试的类相同的名称。
When nose looks inside of a test class, it runs methods matching that same regular expression.
当nose 检查测试类的内部时,它运行与同一正则表达式匹配的方法。
The runner is smart enough to figure out which test class depends on which version of JUnit and invoke it appropriately.
运行程序足够智能,可以分辨出哪个测试类依赖于哪个版本的JUnit,并适当地调用它。
Listing 6 a test class for a special Facebook user.
清单6一个特殊的Facebook用户的测试类。
If the test class doesn't run, spend your time getting XPath support working before spending hours on writing code that might not work when it counts.
如果测试类不能运行,那么请在编写代码之前花点时间获得XPath支持,否则编写的代码可能不会正常运行。
Eclipse's JUnit integration can generate the test class automatically, so I can minimize my work by letting the tools do it for me.
集成在Eclipse上的JUnit可以自动生成测试类,因此我让工具为我生成,从而减小我的工作量。
With JSFUnit API, the test class methods can submit data on a form and verify that managed beans are properly updated.
有了JSFUnitAPI,测试类方法可以提交表单数据,并且验证管理的bean是否被正确更新。
Listing 12 a test class for a polymorphic Facebook user record.
清单12一条多态Facebook用户记录的测试类。
The above listing is a test class which performs basic tests on the feedparser module.
上述清单是实现feedparser模块基本测试功能的测试类。
A simple test class for the polymorphic special Facebook user is presented below.
下面给出一个多态Facebook特殊用户的简单测试类。
For instance, what will happen if I run the CreateWidgetUATest test class twice in a row?
比如,如果对一行运行两次CreateWidgetUATest测试类会怎样?
HierarchyBuilder's constructor is private, however, so I can't test it via my test class (nor do I care to); therefore, my line coverage still hovers at 88%.
然而,因为HierarchyBuilder的构造器是private类型的,所以我不能通过我的测试类测试它(我也不关心)。因此,我的行覆盖率仍然只有88%。
The test class contains test fixtures, which are initialized in a setUp function.
测试类中包含测试装置(fixture),它们在setUp函数中初始化。
JsfTestCase: This is the base test class for unit tests for Servlet and JSF components in a web application.
AbstractJsfTestCase:这是对web应用的Servlet和JSF组件进行单元测试的基础测试类。
Back inside the test class, we define the MockTransaction class as a member class, as shown in Listing 5.
后退到测试类内部,我们将mocktransaction类定义为成员类,如清单5中所示。
Your test class now has a protected field called account, and the test method initializes it.
现在您的测试类有一个叫做account的受保护的字段,测试方法对其进行了初始化。
The ScaTestExecutor constructor takes the test class and the name of the test as parameters.
ScaTestExecutor构造函数将测试类和测试的名称作为参数。
It is also invoked by the JUnit test class com.ibm.etools.egl.ui.wizard.EGLWizardUtilitiesTest that is provided with the sample code.
同时它也被Junit测试类com . ibm . etools . egl . ui . wizard . EGLWizardUtilitiesTest调用,随样品代码一起提供。
The usual programming model with JUnit version 3.8 is to create a test class that extends one of the TestCase classes provided by JUnit.
JUnit版本3.8的常见编程模型是创建测试类,它扩展了JUnit提供的一个testcase类。
The beauty of using JUnit is that the framework takes care of loading the test class, running the test, and reporting the results.
使用JUnit的美妙之处在于,该框架负责装入测试类、运行测试以及报告结果。
In Listing 3 I've created the class shell that will serve as my test class as I write the dictionary application.
在清单3中,我创建了类shell,它作为在编写字典应用程序时的测试类。
We will first create a JUnit test class, add a single test to the class, and then, finally, execute the test.
我们首先创建JUnit测试类,将单个测试添加到该类,最后执行该测试。
Since you are using the cactus framework, you will extend the cactus test class org.apache.cactus.ServletTestCase. To do this.
由于您是在使用cactus框架,您将扩展cactus测试类or g . apache . cactus .ServletTestCase。
应用推荐