构造函数要处理来自构造函数初始化式的异常,唯一的方法是将构造函数编写为函数测试块。
The only way for a constructor to handle an exception from a constructor initializer is to write the constructor as a function try block.
为什么呢?因为该代码块指定了在测试正确的情况下,我将进行的一系列操作。
Why? Because that block identifies a set of things that I'm going to do if the test is true.
结果和第一个测试结果相似:这个瘦演员拿了30块糖,参与者们也跟着拿糖,但拿的数量显然更多。
The results were similar to the first test: the participants followed suit but took significantly more candy when the thin actor took 30 pieces.
这些科学家说,这个设备由两块导体组成,由一个橡胶带夹在头两侧,在一次简单的计算测试中能明显的提高成绩。
The device, which consists of two conductors fastened to the head by a rubber strap, significantly boosted results in a simple arithmetic test, they said.
这样就为要测试的类提供了一种设计,这种设计使您每一时刻都只需集中考虑一小块代码。
Doing so provides a design for the class that the test will exercise, allowing you to focus on small chunks of code.
对于的风险问题(比如说,“如果你与患有肺结核的病人一块工作的话,那么你必须带口罩”),普通人同样也处理得当。沃森卡卡片测试也同样展现这类问题。
Ordinary people are similarly attuned to questions of risk (" If you work with tuberculosis patients, then you must wear a mask, "for example), and the Wason test shows this, too.
在测试了数以百计的材料之后,他们把一块缠在一起的棉线烘烤到碳化状态。
After testing hundreds of materials, they baked a piece of coiled cotton thread until it was all carbon.
它们做的基本上是同一件事:测试一个条件,如果该条件为真,则继续执行提供的代码块。
Fundamentally, each of these does exactly the same thing: it tests a condition, and if true, continues to execute the block of code provided.
匿名块如何为过程代码的测试、原型化和问题诊断提供便利。
How anonymous blocks can facilitate the process of testing, prototyping, and troubleshooting of procedural code.
在功能验证测试阶段中,不明显的功能块也会被仔细地验证。
During the function Verification Test phase, discreet pieces of functionality are verified in detail.
这个优点让匿名块在诊断问题、原型化和测试过程代码时发挥重要作用,因为这些任务通常需要多个更改-执行过程。
That makes the anonymous blocks very useful when troubleshooting, prototyping, and testing procedural code, because these are tasks that usually require multiple change-and-execute runs.
将位于方法开头、说明该方法所起作用的注释块翻译为单元测试。
Translate block comments at the beginning of methods describing what the method does into unit tests.
它为您提供了一个简单的机理,以使用一个测试良好,较低层次构建块项目的联合体,来部署非常复杂的自动化过程。
This provides a simple mechanism for you to deploy very complex test automation processes using a collection of well-tested, lower-level building block projects.
如前所述,匿名块的最常见用法就是调用过程语言对象,通常是为了进行测试。
As mentioned, one of the most common USES of anonymous blocks is to invoke procedural language objects, typically for testing purposes.
TDD 能够促进这种做法,因为为了进行测试,必须把软件分解为小的功能块。
TDD facilitates this because you must have small chunks of functionality for testability.
如果该类附带一个名称并且不是放在完全不同的代码块的中间,代码将更易于阅读和测试。
Your code will be much easier to read and test if the class has a name attached and isn't placed right in the middle of an entirely different block of code.
对一小块功能进行迁移、测试并集成比对一大块要容易得多。
It is far easier to migrate, test and integrate one small piece than to attempt to do the same with a larger set of functionality.
其中有一个关注域是工程生产力(engineering Productivity,EP),它包括了一些“横向和纵向的工程规范(horizontal and vertical engineeringdisciplines)”,测试是其中最大的一块。
One such Focus Area is engineering Productivity (EP) having several "horizontal and vertical engineering disciplines", Test being the biggest. EP consists of.
当您编写越来越多的测试用例时,将发现对于许多测试,eval块很有用。
As you write more and more test cases, you will find that eval blocks are very useful for many tests.
注意,我在经过改进(和扩展)的测试脚本中放入了 main 代码块,这样,如果您在命令行中指定了XML文件,脚本将继续执行以前的行为。
Note that in the improved (and expanded) test script, I arranged the _main_ block so that if you specify XML files on the command line, the script continues to implement the prior behavior.
然后,在规则的结果块使用该引用,将测试分配给Machine对象。
This reference is then used in the consequence part of the rule to assign tests to the Machine object.
对于asyncEcho测试,它将断言包装进一个try/catch 程序块,并且,任何错误都将通过 deferred.errback(error)调用被传递回DOH。
With the asyncEcho test, it wraps the asserts in a try/catch, and any errors are passed back to the DOH through the deferred.errback(error) call.
这个例子测试了一块正文文本的字体(Georgia对Verdana)。
The test example above tests the font (Georgia vs. Verdana) of a block of body copy.
if语句,它基于测试表达式的结果执行一个特定的语句块。
The if statement, which executes a particular block of statements based on the result of a test expression.
当PureCoverage报告高级别的代码覆盖时,您可以知道并没有引入新的代码块,因此不必增加自动测试。
And when PureCoverage reports a high level of code coverage, you know you have not introduced new blocks of code without also adding automated tests to exercise them.
while循环,它当一个测试表达式为true时执行一个语句块。
The while loop, which executes a block of statements as long as a test expression is true.
describe方法提供了RSpec描述,您将传入测试类的名称和包含实际规范的代码块。
The RSpec descriptions go in a describe method, and you pass in the name of the class under test and a code block that has the actual spec.
但是为了提供给阿波罗登月任务所需要的测试和研究设备寻找一块更大场地。
But a bigger site was sought to accommodate the testing and research facilities needed for the Apollo mission to the Moon.
但是为了提供给阿波罗登月任务所需要的测试和研究设备寻找一块更大场地。
But a bigger site was sought to accommodate the testing and research facilities needed for the Apollo mission to the Moon.
应用推荐