现在您有一个即将失败的测试程序,它将告诉您真正需要编写那些代码。
Now you have a failing test that tells you exactly what code to write.
第二次测试将提供指示失败检索的状态代码。
The second test would supply a status code indicating a failed retrieval.
标准的TDD只编写能够使一个测试失败的足够多的代码。
修改任何代码前先编写一个会失败的简短测试。
这段代码运行的时间十分合理,但是几个测试断言都失败了。
This code runs in a respectable time, but a couple of the test assertions fail.
因此,编写足够的代码来使测试进行编译、运行但结果失败。
So, write just enough code to get the test to compile, run, and fail.
因此,编写足够的代码来使测试进行编译、运行但结果失败。
So, write just enough code to get the test to compile, run, and fail.
应用推荐