???Visual Studio 2013???е??????--?????
???????????? ???????[ 2015/6/11 15:09:03 ] ??????????????? ???????
????10.???????????????????????????????????????е??????????????????????????????8???????????
??????????????????????????????????????TestMethod???????TestClass??????????????????
???????????????????????OK????F6.????????????????????????????????TestMethod1????
????11.??????????????????????????????ù???????????????????????????????????????VS??????????????????á?
????12.???????????????????TestMethod????????????????????????AddTest????????????Add??????
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace UnitTestDemoTest
{
[TestClass]
public class ProgramTest
{
[TestMethod]
public void AddTest()
{
}
}
}
????13.?????????????????????????????е??????????????????????????????????????????
??????в????????????????????????????????????????????????????У?
???????в?????????????????????????в??????????
??????е???????????к????Щ?????????????????????
????14.?????????????????????????顣???AddTest??????
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace UnitTestDemoTest
{
[TestClass]
public class ProgramTest
{
[TestMethod]
public void AddTest()
{
int num1 = 100;
int num2 = 200;
Assert.AreEqual(Program.Add(num1?? num2)?? 300);
}
}
}
???????????????Program?????????internal????Public??
????15.“Assert”???????????????????????????????????????????跭??
??????????????“Assert”???????“????”??????“Assert.AreEqual(Program.Add(num1?? num2)?? 300);”??仰?????????????“Program.Add(num1?? num2)”??????300??
????????????????????????????????????ɡ??????????????????????????????????????????????
?????????к??????????????????Assert??????????????????????????
???????Assert.AreEqual(expected?? actual)????д???Assert.AreEqua?????expected??actual????????????????????????????????????????ж???????????????????
????Assert.AreEqual() ??????????????????????????????????
????Assert.Inconclusive() ??????δ?????????
????Assert.IsTrue() ?????????????????True??????True????????????
????Assert.IsFalse() ?????????????????False??????False????????????
????Assert.IsNull() ????????????????????????????????????????
????Assert.IsNotNull() ???????????????????????????????????????
????16.ok?????в??????????????????
????17.??????????????????????????????????????????д???????????????в??????
???????????????????????????????д???????????????鷳????????????“Unit Test Generator”?????????????????????????
???????????????????????д??????????
????“Unit Test Generator”???????VS????????????-->???????????-->????““Unit Test Generator””??á?
????18.???“Unit Test Generator”???????VS??
????????????е????????????????????????????????????????????????????????
????????????????????????????????????????????úú???ok????????????????
????19.????????????????????????????
??????
???·???
??????????????????
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