Enhancement - Task::operator==

- Implemented Task::operator==.
- Implemented unit tests.
This commit is contained in:
Paul Beckingham 2009-06-25 17:08:39 -04:00
parent a56eeb9ec2
commit 1cfe879409
3 changed files with 24 additions and 1 deletions

View file

@ -32,7 +32,7 @@ Context context;
////////////////////////////////////////////////////////////////////////////////
int main (int argc, char** argv)
{
UnitTest test (34);
UnitTest test (36);
test.is ((int)Task::textToStatus ("pending"), (int)Task::pending, "textToStatus pending");
test.is ((int)Task::textToStatus ("completed"), (int)Task::completed, "textToStatus completed");
@ -146,6 +146,13 @@ TODO Task::*Annotation*
*/
// Task::operator==
Task left ("[one:1 two:2 three:3]");
Task right (left);
test.ok (left == right, "left == right -> true");
left.set ("one", "1.0");
test.notok (left == right, "left == right -> false");
return 0;
}