????TDD
??????????????????£?
?????????????????????2975??????????6?λ???????????????2509????????? 1A2B??????????“2”λ?ò??&&????????????1A????“9”??“5”???????????λ????в??????2B???????????2975?????4???????????????λ????????????4A0B?????????????????????????????http://baike.baidu.com/view/358630.htm??
?????????????????????????????????????????????2???????????????????????????????????????????TDD?????????????Test First.Why? ???????TDD?????????????????????????????????????????????“?????????”??
?????????????VS????????汾??C#?????????????????????????????0.5?????
????????????????ó??????????????????С??????????????????????????????д???To-Do-List??
????To-Do-List:
?????2?????
???????????
?????????
???????????
????????2???
????...............
???????????????????绹??????????????????????????????????????????
????????????????????????????2??????????????Guesser????????????????????????????????????????????????????4a0b???????? 0a4b(????????λ?????)??2a2b(????????0a0b(???)????4??CASE???Cover????????????????в?????Follow??
??????TO-DO-LIST:
???????????????????????2975??
????????“2975” ???4a0b??
????????“2957” ???2a2b??
????????“9257” ???0a4b??
????????“1348” ???0a0b??
???????Guesser??.
??????????TEST д?????
????????????CASE??????2975 ???????????4a0b ??
[TestMethod]
public void Test1()
{
var inputNumber = "2975";
var actual = new Guesser().Guess(inputNumber);
Assert.AreEqual("4a0b"?? actual);
}
???????????????????????????????????????????????????????????????????????????????????????????????????????????????????
[TestMethod]
public void should_return_4a0b_when_input_numbers_all_figures_and_positions_are_right()
{
var inputNumber = "2975";
var actual = new Guesser().Guess(inputNumber);
Assert.AreEqual("4a0b"?? actual);
}
?????????????????????????????? ??????????????????????????????????2????????????????2??????????
????OK???????????CASE?????Run????