??????????????е??????
???????????? ???????[ 2015/4/24 13:43:36 ] ??????????????? API ???? ???
????????????????????????
1 namespace Explorations
2 {
3 [TestClass]
4 public class ExampleTest
5 {
6 private PrivateObject privateObject;
7 const string PASSWORD = "letmein";
8
9 [TestInitialize]
10 public void TestInitialize()
11 {
12 privateObject = new PrivateObject(typeof(Example));
13 }
14
15 [TestMethod]
16 public void ComparePrivatePassword()
17 {
18 string password = (string)privateObject.GetField("password");
19 Assert.AreEqual(PASSWORD?? password);
20 }
21
22 [TestMethod]
23 public void TestPrivateVerifyPassword()
24 {
25 bool accepted = (bool)privateObject.Invoke("VerifyPassword"?? PASSWORD);
26 Assert.IsTrue(accepted);
27 }
28 }
29 }
????????PrivateClass???????????????????y???????Object???????????????????
????PrivateObject?????????????????????????????о???????????????PrivateType??????????PrivateObject??????????????????????????
????Visual Studio??????????????????????????????????????????????????????????????й???????Щ??????е??????????????????????Щ???????????漰???????Ρ?
?????????????????Ч????????????????κ???д??????????????????????????
????????????????????????????????????????в??????Code Coverage Results?????п???????????????
????????????????ζ????????????????????????????ò???????????????????ж?β?????????????????Ч???????????Σ????????????
??????ò?????????????????????????????Щ??????????????????????????????????????????Щ???????е????????????????????
????????ò??????????????????????VS???????????????????????洢??TFS Version Control?У?????????е????????????????????????????????????????????MTM(Microsoft Team Manager)???е????????????????????TFS???????????????????????????????в?????????????????????????
??????
???·???
??????????????????
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