谁能帮忙翻译一下计算机专业英语?急ing....

Constraint-BasedAssertModelTheconstraint-basedAssertmodelusesasinglemethodoftheAssert... Constraint-Based Assert Model
The constraint-based Assert model uses a single method of the Assert class for all assertions. The logic necessary to carry out each assertion is
embedded in the constraint object passed as the second parameter to that method.
Here's a very simple assert using the constraint model:
Assert.That( myString, Is.EqualTo("Hello") );
The second argument in this assertion uses one of NUnit's syntax helpers to create an EqualConstraint. The same assertion could also be made in this form:
Assert.That( myString, new EqualConstraint("Hello") );
Using this model, all assertions are made using one of the forms of the Assert.That() method, which has a number of overloads...
If you derive your test fixture class from AssertionHelper, the Expect() method may be used in place of Assert.That()...
In each case, the overloads that take a bool function identically to Asser.IsTrue.
For overloads taking a constraint, the argument must be a object implementing the IConstraint interface, which supports performing a test on an actual value and generating appropriate messages. This interface is described in more detail under Custom Constraints.
NUnit provides a number of constraint classes similar to the
EqualConstraint used in the example above. Generally, these classes may be used directly or through a syntax helper. Test fixture classes inheriting from AssertionHelper are able to use shorter forms. The valid forms are described on the pages related to each constraint. Note that the menu items listed to the right generally reflect the names of the syntax helpers.
See also: the classic model of assertions.
展开
 我来答
nintendo_s
2008-01-02 · TA获得超过1197个赞
知道小有建树答主
回答量:361
采纳率:0%
帮助的人:293万
展开全部
基于约束断言模式
该基于约束断言模型采用单一方法的断言班上所有的断言。逻辑,有必要进行相互说法
嵌入在约束对象通过作为第二个参数,以这种方法。
这里的一个很简单的断言,利用约束模型:
assert.that ( mystring , is.equalto ( "你好" ) ) ;
第二个论点,在此断言用途之一nunit的语法助理员创造一个equalconstraint 。同时断言,也可以使用这种表格提出申请:
assert.that ( mystring ,新equalconstraint ( "你好" ) ) ;
利用这个模型,所有的言论,都是用一种形式的assert.that ( )方法,其中有一些超重...
如果你获得你的测试夹具阶层assertionhelper ,期望( )方法可以用来代替assert.that ()...
在每一种情况下,超载即采取bool功能相同,以asser.istrue 。
对于超重的考虑,限制了,这样的论点必须是一个实现了iconstraint接口,它支持在执行一项试验的实际价值和创造适当的讯息。这个界面是有更详细的说明,根据习俗的限制。
nunit提供一系列的约束类似班级向
equalconstraint用在上面的例子。一般来说,这些班,可直接使用或通过语法帮手。测试夹具班继承assertionhelper能够使用较短的形式。有效形式描述对页彼此相关的限制。注意的是菜单项列出,以正确的理论普遍反映的名字语法助理。
另见:经典模型的断言。

参考资料: google

推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式