Write code before you write a test.
在编写测试前编写代码。
Just write a test and get it to pass.
仅仅编写测试,使它通过。
Before you start fixing it, write a test.
修复它之前,首先编写一个测试。
编写一个测试。
So the next step is to write a test for this method.
所以下一步就是为这个方法编写一个测试。
All this theory is great, but how do you write a test first?
整个理论很棒,但如何先编写测试呢?
How can you write a test for something that doesn't exist yet?
如何为尚不存在的代码编写测试呢?
Next, you will write a test case for the Address_To_AddressCSV data map.
下一步,您将为Address_To_AddressCSV数据映射编写测试用例。
Instead, write a test, then write just enough code to get that test to pass.
相反,您只需编写测试,然后编写足够的代码使其能通过测试。
In some rare instances, I just can't figure out how to write a test at all.
在少数情况下,我恰好根本想不出如何编写测试。
Even though I haven't written a lick of code yet, it's time to write a test.
即使我还没有编写一丁点代码,但也该编写测试了。
When fixing a bug, first write a test that fails because of it, then fix the bug.
当修正bug的时候,先要写一个能针对它的测试,然后再修复bug。
Every time you write new code, add a test, and every time you fix a bug, write a test.
每次编写新代码时,添加一个测试,每次修复一个bug时,编写一个测试。
The mantra for coding TDD is: "What is the simplest thing for which I can write a test?"
编写TDD的信条是:“可以为其编写测试的最简单内容是什么?”
Accordingly, I can write a test case to verify XMLUnit's behavior, as shown in Listing 6.
相应地,我可以编写测试用例来验证XMLUnit的行为,如清单6所示。
NUnit lets you write a test case in the same language and environment as your application.
Nunit允许你用与应用程序相同的语言和环境来写测试用例。
JUnit has a bit of this pattern language approach, because it can help you write a test case.
JUNIT使用了一点模式语言的方法,因为它能帮你写一个测试用例。
The first thing to do is write a test for the simplest possible transfer behavior, such as the code in Listing 4.
我们要做的第一件事就是为最简单的转帐行为写一个测试,比如清单4中的代码。
At this point, the DLL will compile and link, so one could write a test program to use the Sample API and test it.
此时将编译和链接dll,因此可以编写测试程序来使用ExampleAPI并对其进行测试。
You want the test to verify that the elements List now holds the Object added by push. So, you write a test like this
您需要进行这一测试来验证elementsList现在是否含有 push添加的Object。
Perhaps the rationale for this is that, by knowing who the owner is, you can gently prod that person to write a test case.
也许它的基本原理是,通过了解所有者是谁,您可以温和地让此人书写测试用例。
Next, you want to write a test that verifies not only that the output is present, but that it's correct. There are two ways you can do this
接下来,您想要编写一个测试,不仅要验证输出得到了显示,还要验证输出是正确的。
After checking with Wikipedia to find the first few perfect Numbers, I can write a test that verifies that I can in fact find perfect Numbers.
在Wikipedia上查找到前几个完全数之后,我可以编写一个测试,它检查实际上是否可以找到完全数。
Before attempting to write a test for the code in Listing 1 (and indirectly Listing 2), you might want to ascertain what exactly requires testing.
在企图为清单1(间接的是清单2)的代码编写测试之前,可能想确定实际需要测试什么。
This "write a test, write just enough code to get it to pass, rerun the test" approach is the xp development flow that you should experience every day.
这种“编写一个测试,编写足够的代码来使测试通过,重新进行测试”方法是您每天都在经历的XP开发流程。
I still want to have a test so I can have the confidence that comes from a full regression suite, but I have to write some code first, then write a test.
我仍然希望进行测试,这样我可以从完整的回归套件中获得信心,但我必须先编写一些代码,然后编写测试。
From a functional standpoint, you'd probably want to write a test to fill in the form value, click the Submit button, and then verify the presence of the definition under the form.
从功能性观点考虑,您或许希望编写一个测试:填入表单值,单击Submit按钮,然后验证表单是否显示定义。
From a functional standpoint, you'd probably want to write a test to fill in the form value, click the Submit button, and then verify the presence of the definition under the form.
从功能性观点考虑,您或许希望编写一个测试:填入表单值,单击Submit按钮,然后验证表单是否显示定义。
应用推荐