v3
This commit is contained in:
parent
41988f0df6
commit
a1dbab091d
11 changed files with 30 additions and 44 deletions
|
|
@ -1,4 +1,4 @@
|
|||
//Tóth Dániel Mátyás | IFPQYY | V2
|
||||
//Tóth Dániel Mátyás | IFPQYY | V3
|
||||
#include "pch.h"
|
||||
#include "CppUnitTest.h"
|
||||
#include <iostream>
|
||||
|
|
@ -97,6 +97,7 @@ namespace UnitTest1
|
|||
{ 1972, 1, 1 },
|
||||
{ 1970, 1, 2 },
|
||||
{ 1970, 1, 1 },
|
||||
{ 1970, 1, 1 },
|
||||
};
|
||||
int dates2[][3] = { //expected
|
||||
{ 1970, 1, 2 },
|
||||
|
|
@ -107,6 +108,7 @@ namespace UnitTest1
|
|||
{ 1972, 12, 31 },
|
||||
{ 1970, 1, 1 },
|
||||
{ 1970, 1, 1 },
|
||||
{ 1970, 1, 1 },
|
||||
};
|
||||
int counts[] = {
|
||||
1,
|
||||
|
|
@ -116,7 +118,8 @@ namespace UnitTest1
|
|||
365,
|
||||
365,
|
||||
-1, //technically allowed
|
||||
- 1 //since SubDays calls AddDays, this counts as its test
|
||||
- 1, //since SubDays calls AddDays, this counts as its test
|
||||
-100,
|
||||
};
|
||||
int testcount = sizeof(dates1) / 12;
|
||||
for (size_t i = 0; i < testcount; i++)
|
||||
|
|
@ -132,7 +135,7 @@ namespace UnitTest1
|
|||
}
|
||||
catch (const CMyDateException& e)
|
||||
{
|
||||
Assert::AreEqual(CMyDateException::ErrMinYear, e.what()); //should only happen in the last case
|
||||
Assert::AreEqual(CMyDateException::ErrMinYear, e.what()); //should only happen in the last two cases
|
||||
}
|
||||
catch (...) {
|
||||
Assert::IsTrue(false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue