|
|
@@ -5,6 +5,7 @@ using namespace Microsoft::VisualStudio::CppUnitTestFramework; |
|
|
|
#define FileName_1 "../Alogrithm/config/1_ContainsNearbyDuplicate.ini" |
|
|
|
#define FileName_2 "../Alogrithm/config/2_ExcelSheetColumnTiTle.ini" |
|
|
|
#define FileName_3 "../Alogrithm/config/3_bool IsUgly.ini" |
|
|
|
#define FileName_4 "../Alogrithm/config/4_IsPalindrome.ini" |
|
|
|
|
|
|
|
namespace UnitTest |
|
|
|
{ |
|
|
@@ -56,5 +57,20 @@ namespace UnitTest |
|
|
|
Assert::AreEqual(nReal, CstrToBool(nExpect)); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
TEST_CLASS(UnitTest_4) |
|
|
|
{ |
|
|
|
TEST_METHOD(TestMethode1) |
|
|
|
{ |
|
|
|
char Section_Name[100][10] = { 0 }; |
|
|
|
int Section_Count = CalcCount(100, Section_Name, FileName_4); |
|
|
|
CString Na, nExpect; |
|
|
|
for (int i = 0; i < Section_Count; i++) { |
|
|
|
GetPrivateProfileString(Section_Name[i], "Na", " ", Na.GetBuffer(20), 20, FileName_4); |
|
|
|
GetPrivateProfileString(Section_Name[i], "nExpect", " ", nExpect.GetBuffer(20), 20, FileName_4); |
|
|
|
bool nReal = IsPalindrome(_ttoi(Na)); |
|
|
|
Assert::AreEqual(nReal, CstrToBool(nExpect)); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
} |