Note: The two-digit line numbers on the very left edge of the listing are for explanation purposes; they don't appear in the code.
注意:清单左端的两位数行号仅用于解释目的;它们不出现在代码中。
Putting this all together yields a flexible test class that verifies two scenarios: a sunny-day path and an edge case where no definition is provided, as shown in Listing 7.
结果产生一个灵活的文本类,它将检验两种场景:一种是良好的场景,而另一种是没有提供定义的边界用例,如清单7所示。
Listing 5 depends on certain behaviors for substring in some edge cases, as well as the conversion of Boolean values to Numbers.
清单5依赖于substring在某些边界情况下的行为以及布尔值到数字的转换。
Listing 4. Testing an edge case: What if someone presses the button without typing in a word?
清单4.测试一个极端例子:如果有人没有输入单词就按下了按钮该怎么办?
Listing 5. Another edge case verified with ease!
清单5.轻松验证另一个极端例子!
Listing 5. Another edge case verified with ease!
清单5.轻松验证另一个极端例子!
应用推荐