#include "gtest/gtest.h" #include "TestFunction.h"
//MyAdd(int a, int b) { return a+b; }
TEST(MyAdd, 4plus4) { EXPECT_EQ(MyAdd(4,4), 8); EXPECT_TRUE(true); }//經過
TEST(MyAdd, 5plus5) { EXPECT_EQ(MyAdd(5, 5), 8); EXPECT_TRUE(true); }//不經過
int main(int argc, char* argv[]) { testing::InitGoogleTest(&argc, argv);//將命令行參數傳遞給gtest
return RUN_ALL_TESTS(); //RUN_ALL_TESTS()運行全部測試案例
system("pause"); }