??????????????е??????
???????????? ???????[ 2015/4/24 13:43:36 ] ??????????????? API ???? ???
???????????????????????????Visual Studio???????δ???????????????????????????????????ExpectedException???????????????????Assert??????FibonacciTest()????????????
????1 [TestMethod]
????2 public void FibonacciTest()
????3 {
????4 const int FACTOR = 8;
????5 const int Expected = 21;
????6 int actual = ExtendedMath.Functions.Fibonacci(FACTOR);
????7
????8 Assert.AreEqual(Expected?? actual);
????9 }
???????д?????????????3A?????а???——Arrange?? Act?? Assert. ???????????????????????????????????????????????????????????????A????y??????????????Ρ?
???????TestInitialize?????????????????÷?????????????????????????????????????Ρ???????TestCleanup?????????????????????????С?????????????????????Щ????????????????е??????????????в???????????TestInitialize??????????????е?????????????????????????????TestCleanup??
??????????ж???ε??????ClassInitialize??ClassCleanup????????????????????Ρ???????????????????????????TestContext????????????
???????????ClassInitialize??ClassCleanup?????????????????????????????????????????AssemblyInitialize??AssemblyCleanup????????磬??AssemblyInitialize???ε??????????????????????????????????У??????????????????е???????Щ????????????????????????TestContext??????????
???????????????й????????????????????AssemblyInitialize??AssemblyCleanup???????????????????????????ó?????????????????????ó?????????????
??????????????????????÷???????????????????????б???
????Assert.AreSame/Asser.AreNotSame?????÷???????????????????????????????????????????????????????????????????????????????????????????
????????????????????????TestContext??????????????????????????????????????????????????????????????????????洢???????????????????????
???????????????????????????????????????????д???Visual Studio?????????????????????????????????????????????????????ж???????Ρ?
??????ζ???????г?????в???????????????д?????к????????????????????????????????????????????????????????÷????????????????????????г?????????4??????????
????1. ????????????г??????????г??
????2. ????????????г??????????????????????????????????????internalsVisibleTo??????
????3. ?????????????г???????????г???????????????Щ???г?????в???
????4. ?????????.NET???????????????Щ????г??
??????????????????????????????κ???????в????
????1 public class Example
????2 {
????3 public Example()
????4 { }
????5 private string password = "letmein";
????6 private bool VerifyPassword(string password)
????7 {
????8 return (string.Compare(this.password?? password?? false) == 0);
????9 }
????10 }
????Visual Studio??????PrivateObject????????????????????????????????????????????????????г???????????????????????????????????????????????賬??????Type????
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 }
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
iOS???????mocha??chai??sinon??istanbul???????????????????????????????????????д?????Java????????7??????Android?????????Robolectric3.0????(?)???Kiwi?????????????????????????????????Python?????????????????????????????????????Controller????????д?????????10???????????????????Angular????????????Component??Directive??Pipe ???ServiceAndroid????????????????????????????????--Mockito??????iOS UnitTest???????Vue?????????????????
???·???
??????????????????
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????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????