??????????????????
?????????????????????????н????????
???????|???|????????????"????????"?????
???????????Visual C++|????|??????????????
?????????????????TestStock?????????????????????????????????????????????
???????????в????
???????????????????|????|???????????????????????????????????????????????????????????????????????Test1?????????????????????
???????????????Mfc????е?????
?????????????????????Dll???????????????????Mfc???????е????????????????????????????Mfc???????е??????obj????????????£?
????1????Stock????д???????????
?????????????????Demo?????????????????????cpp???????????Stock???
????2???????????????????????????????????????????
????????????????????У?????????|??????|???棬????????????м???
????$(SolutionDir)Stock$(Configuration)
?????????????????????????????Debug?????$(SolutionDir)????????????????$(SolutionDir)Stock???????????μ?Stock??????$(Configuration)??debug?????е???Debug??????????????????????demo.obj
???????????????|?????У?????????????????demo.obj????????·?????????????????????????г??????????????????
?????????????demo??????????#include "demo.h"?????????????????δ????????????????????????????У?????????|C/C++|???棬??"?????????"??????$(SolutionDir)Stock??????Demo.h?????????С?
????3???????????д???Demo??????
????????????????????unittest1?????
????????#include "Demo.h"
?????????TEST_METHOD(TestMethod1)????????????????
????Demo demo;
????????????????????????????????C???п??????δ??????????????????????????????μ????????
????4??C???п??????
???????????Mfc???????????t??????Mfc????????????????/MTD??????????C???п???????????????????/MDD??????????C???п?
?????????????????????п??????????/MTD???ɡ?
?????????????????????????????|C/C++|????????????п????????????????? (/MTd)
????5??δ????????????????
???????????????demo.cpp??include??stdafx.h????????????????????????demo.obj???????stdafx.obj???ɡ?
??????????????д????????
????1????Stock????е?????????demo?????????Add????????????????????
????????????????Add??????Cpp????????????????????0??????κ????顣????????????????????
????2???????????У???????????????
TEST_METHOD(TestMethod1)
{
Demo demo;
Assert::AreEqual(5?? demo.Add(2?? 3));
}