Unit Tests - Task::validate

- Implemented first (of many) Task::validate tests.
This commit is contained in:
Paul Beckingham 2009-06-30 23:57:27 -04:00
parent 652f9b3c0a
commit b7a0883212

View file

@ -32,7 +32,7 @@ Context context;
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
int main (int argc, char** argv) int main (int argc, char** argv)
{ {
UnitTest test (36); UnitTest test (37);
test.is ((int)Task::textToStatus ("pending"), (int)Task::pending, "textToStatus pending"); test.is ((int)Task::textToStatus ("pending"), (int)Task::pending, "textToStatus pending");
test.is ((int)Task::textToStatus ("completed"), (int)Task::completed, "textToStatus completed"); test.is ((int)Task::textToStatus ("completed"), (int)Task::completed, "textToStatus completed");
@ -153,6 +153,12 @@ TODO Task::*Annotation*
left.set ("one", "1.0"); left.set ("one", "1.0");
test.notok (left == right, "left == right -> false"); test.notok (left == right, "left == right -> false");
// Task::validate
Task bad ("[entry:1000000001 start:1000000000]");
good = true;
try { bad.validate (); } catch (...) { good = false; }
test.notok (good, "Task::validate entry <= start");
return 0; return 0;
} }