Picking up from my last message
On Mon, Jun 30, 2008 at 6:29 PM, Bill Turner, WB4ALM <wb4alm@...> wrote:
> Download, and ran it...
> here is what I got (Two errors?)
Two *failures*. For a little terminology. When you write a test case
there are 2 expected outcomes. It is expected that the test case
either passes or fails.
So in ooTest, a failure is a test case that did not pass. An error is
an *unexpected* event.
In the two failures you get the following output, I'm going to just do 1:
[failure] [20080630 21:13:05.256881]
Expected: [['123.'], identityHash="1026778040"]
Actual: [['231.'], identityHash="947247732"]
The above shows that the name of the failed test was
TEST_MULTIPLE_INHERITANCE_WITH_MULTIPLE_METACLASSES and it can be
found on line 576 in the file ... Class.testGroup.
What failed was an assertion that two things were equal. It was
expected to be equal to '123' but it actually was '231'
Unfortunately these two test are a little complex, maybe not the best
for an intro, but to continue with what we have. If we look at the
failing test file on line 576 we see:
Okay, it has a method, but just bear with me for a second. This is
the heart of writing a test case.
Think of the method just as a routine for now with some prefix on it
that you do not need to worry about. The routine has 2 args and what
we are doing is asserting that the 2 args are equal.
If they are not equal, the test case fails and the ooTest framework
takes care of all the details of reporting the failure. That is the
print out you see above. For now, don't worry about how the framework
does this, just accept that it does it.
Okay, next, let's look at the lines around 567, and you see this:
Think of the method as a routine for now that is named:
And that is the test name, the name reported in the print out. That
is the assertion. The test writer is asserting that "123" is equal to
.class123~info. The assertion failed, the test failed.
You and I don't need to figure out what .class123~info is right now.
Okay, enough for 1 message.