??д??????????
???????????? ???????[ 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