??写??????????
???????????? ???????[ 2012/7/3 11:15:57 ] ????????
??????????????????????????????????????????????????懈?????????????????????????????????????????????????????????????????????????????
???????????
?????????械?????????????????????????????????????Person?????????????????????????????????????????????????貌??????????????????????????????????????浠�??????????????????????????小?
?????????????????
Assert.IsFalse(person.HasErrors?? "Test setup failed?? HasErrors is not false");
Assert.IsFalse(person.IsChanged?? "Test setup failed?? IsChanged is not false");
Assert.AreEqual("Adam"?? person.FirstName?? "Test setup failed?? FirstName is not Adam");
Assert.AreEqual("Smith"?? person.LastName?? "Test setup failed?? LastName is not Smith");
????????????????????????????????些???????????????????????????????????校??????????????????????????????????????????????????些???????????????????????????
????[TestMethod]
public void Person_FirstName_Set()
{
var person = GetAdamSmith();
...
?????????????
????????????????????????“???????”?????????????????????泄??????????????????胁????????????????????
??????????????????????????????????????????????????械?????????????????写???????????渭???????????????????????????????XML??????????????写????????????????????????????貌????????????谩??些?????MBTest????????????????????????????????????????????????????????????????????
[TestMethod]
public void Person_FullName_Tests()
{
Person_FullName_Test("Bob"?? "Jones"?? "Bob Jones");
Person_FullName_Test("Bob "?? "Jones"?? "Bob Jones");
Person_FullName_Test(" Bob"?? "Jones"?? "Bob Jones");
Person_FullName_Test("Bob"?? " Jones"?? "Bob Jones");
Person_FullName_Test("Bob"?? "Jones "?? "Bob Jones");
Person_FullName_Test(null?? "Jones"?? "Jones");
Person_FullName_Test(string.Empty?? "Jones"?? "Jones");
Person_FullName_Test(" "?? "Jones"?? "Jones");
Person_FullName_Test("Bob"?? ""?? "Bob");
Person_FullName_Test("Bob"?? null?? "Bob");
Person_FullName_Test("Bob"?? string.Empty?? "Bob");
Person_FullName_Test("Bob"?? " "?? "Bob");
}
private void Person_FullName_Test(string firstName?? string lastName?? string expectedFullName)
{
var person = GetAdamSmith();
person.FirstName = firstName;
person.LastName = lastName;
Assert.AreEqual(expectedFullName?? person.FullName??
string.Format("Incorrect full name when first name is ‘{0}‘ and last name is ‘{1}‘"
firstName ?? ""?? lastName ?? ""));
}
???????????????????????????????????????????????????????????????位??些??????????????????????????????
????????
????????魏伪?????写???????????贸????????????????
?????? ????????位???????????????
?????? ?????????????????????????
?????? ?????????????
?????? ??????????????????
??????????些?????????????????????????????????????????????????????妫�??????????? + ?????????写??????????? + ??????API???????????渭?????????? + ????????????????械???????????? + ?????????????卸???????????????????????
??????

???路???
??????????????????
2023/3/23 14:23:39???写?貌??????????
2023/3/22 16:17:39????????????????????些??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???路???????路
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11