Listing 4 shows the test class, again showing the main sections of the test.
清单4显示了测试类,还显示了测试的主要部分。
Listing 16: Base test class for Wicket unit tests of Warsaw and Global projects.
清单16:warsaw和Global项目的Wicket单元测试基类。
The test class contains test fixtures, which are initialized in a setUp function.
测试类中包含测试装置(fixture),它们在setUp函数中初始化。
The above listing is a test class which performs basic tests on the feedparser module.
上述清单是实现feedparser模块基本测试功能的测试类。
Now that I have my test class defined I can start developing (and testing) the application.
定义了测试类后,就可以开始开发(并测试)这个应用程序了。
The ScaTestExecutor constructor takes the test class and the name of the test as parameters.
ScaTestExecutor构造函数将测试类和测试的名称作为参数。
Your test class now has a protected field called account, and the test method initializes it.
现在您的测试类有一个叫做account的受保护的字段,测试方法对其进行了初始化。
When nose looks inside of a test class, it runs methods matching that same regular expression.
当nose 检查测试类的内部时,它运行与同一正则表达式匹配的方法。
With the first way, you pass the test class to the TestSuite constructor by using this command.
对于第一种方法,您可以通过使用这个命令将测试用例传递到TestSuite构造器。
The execution model is a bit strange: The test class is reinstantiated every time a test method is executed.
执行模型有点奇怪:每次执行一个测试方法的时候,都要重新实例化测试类。
Let's examine the test class HumanTaskExampleTest and the data files in the HumanTaskExample-Data directory.
让我们检查一下测试类HumanTaskExampleTest和HumanTaskExample - Data目录中的数据文件。
JsfTestCase: This is the base test class for unit tests for Servlet and JSF components in a web application.
AbstractJsfTestCase:这是对web应用的Servlet和JSF组件进行单元测试的基础测试类。
We will first create a JUnit test class, add a single test to the class, and then, finally, execute the test.
我们首先创建JUnit测试类,将单个测试添加到该类,最后执行该测试。
So make sure you have factory-creation code in your test class, and you're ready to work with the XPath class.
因此测试类中一定要包含工厂创建代码,以便能够使用XPath 类。
In Listing 3 I've created the class shell that will serve as my test class as I write the dictionary application.
在清单3中,我创建了类shell,它作为在编写字典应用程序时的测试类。
Finally, the two lines at the bottom allow you to run the tests within this test class by simply running this module.
最后的两行负责在这个测试类内部运行测试,方法是直接运行该模块即可。
Add a method to TestCase that will test the deposit method on Account. The test class should now look like Listing 1.
向TestCase添加一种方法将测试Account的deposit方法。
With JSFUnit API, the test class methods can submit data on a form and verify that managed beans are properly updated.
有了JSFUnitAPI,测试类方法可以提交表单数据,并且验证管理的bean是否被正确更新。
The runner is smart enough to figure out which test class depends on which version of JUnit and invoke it appropriately.
运行程序足够智能,可以分辨出哪个测试类依赖于哪个版本的JUnit,并适当地调用它。
The beauty of using JUnit is that the framework takes care of loading the test class, running the test, and reporting the results.
使用JUnit的美妙之处在于,该框架负责装入测试类、运行测试以及报告结果。
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可以自动生成测试类,因此我让工具为我生成,从而减小我的工作量。
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 next section of code is where the actual test class (derived from our CustomerManagerContext above) implements the auxiliary and test methods.
下面一部分代码是实际的测试类(继承了上面的CustomerManagerContext类),实现了一些辅助方法和测试方法。
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支持,否则编写的代码可能不会正常运行。
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.
例如,我介绍的一些例子采用的约定是,测试类对其测试方法使用与被测试的类相同的名称。
An instance of the test class represents a test that can be assigned to a machine. A test instance is uniquely described by its id and name, as shown in Listing 3.
test类的实例表示可以分配给机器的测试。
Because we have added the class to the Web application, when we add our module to the server our test class will be available for execution in the server environment.
因为我们已经将类添加到了Web应用程序,所以在将模块添加到服务器时,我们的测试类可以在服务器环境中执行。
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.
测试类表示在开发时发生的测试执行的常见单元,所以我们应仔细考虑任何一个类中包括了多少个测试。
Move the line that initializes account from the test method to setUp , then delete the declaration and initialization from the other test method. Your test class should now look like Listing 8.
将初始化account的代码从测试方法移到setUp,然后删除其它测试方法中的声明和初始化。
Move the line that initializes account from the test method to setUp , then delete the declaration and initialization from the other test method. Your test class should now look like Listing 8.
将初始化account的代码从测试方法移到setUp,然后删除其它测试方法中的声明和初始化。
应用推荐