Write your test code for the model.
为模型编写测试代码。
Listing 10. The viewport test code.
清单10.viewport测试代码。
The test code is shown in Listing 2.
测试代码如清单2 所示
The updated test code is shown in Listing 6.
更新后的测试代码如清单6 所示。
Listing 7: Test code for Weather Web service.
清单7:天气Web服务的测试代码。
The test code changes only a little (see Listing 8).
测试代码只需要稍加修改即可(请参看清单 8)。
Modify the test code to use a set of utility classes
修改测试代码,以使用一组实用工具类
Writing application test code in a scripting language.
在脚本语言中编写应用程序测试代码。
To add a new batch item, I use the following test code.
使用以下测试代码添加新的批处理条目。
In this way, the test code is decoupled from the UI module.
这样,测试代码就和UImodule解耦了。
Now the test code clearly represents the intent of the test.
现在,测试代码清楚地表示出了该测试的意图。
The test code also needs to be upgraded, as shown in Listing 4.
测试代码也需要进行更新,如清单 4 所示。
This refactoring enables the unit test code shown in Listing 1.
该重构启用清单1中所示的单元测试代码。
Finally, the test code printed the result of the get_name call.
最后,测试代码输出get _ name调用的结果。
What if there are tens or hundreds of locators in the test code?
万一这段测试代码里面有几十上百个定位器怎么办?
However, it requires a lot of effort to create robust test code.
然而,它需要投入更多的努力才能创建出智能的测试代码。
The test code would like it to produce a different type (a mock).
测试代码希望它产生另一种类型的对象(模仿对象)。
This means that vendors can test code that has not yet been shipped.
这意味着供应商可以测试尚未发布的代码。
To keep the code simple, I put the class and the test code in one file.
为了保持代码简单,我把类和测试代码放在一个文件中。
You may also be able to generate test code directly from the design models.
你还可以直接从设计模型中产生测试代码。
Assume that you've already written the test code from the previous section.
假定已经编写了上一节中的测试代码。
It is nose that really shines when it comes to supporting common test code.
nose在支持共同测试代码方面是最出色的。
The test code at the bottom illustrates just how much cleaner this syntax is.
底部的测试代码只演示了这个语法干净了多少。
The test code at the bottom then sets the value and prints out the new value.
底部的测试代码设置值并打印出新值。
The test code at the bottom starts by deleting all the entries from the database.
底部的测试代码先删除数据库中的所有条目。
Refactoring is a more tedious procedure than generating new test code from scratch.
重构会是一个比从头生成新测试代码更乏味的过程。
Listing 6 shows the main parts of the test code I'll use to check out the performance.
清单6显示用于检查性能的测试代码的主要部分。
In your test code, create a specialization object that extends (specializes) the target.
在测试代码中,创建扩展(专用于)目标对象的特殊化对象。
Look at all of the scaffolding that was necessary to support two actual lines of test code!
看到了吗?这么多代码只是为了支持两行测试代码!
Our test code, specifically the mock objects, give us total control over the database results.
我们的测试代码,特别是模拟对象,使我们能完全控制数据库结果。
应用推荐