(The form messed up my last post, so let me try it agian via email,
sorry for the double post)
Jeff Chastain <[EMAIL PROTECTED]> wrote:
>Well, the reason I was going with the assertEqualsBoolean() was, how can an
>equality test tell if a given string is a string or a boolean type? I am
>getting the following failure ...
>
> testIsNullID(crTracker2._com.test.propertyTest): : expected:<...>
>but was:<...>
>
>... which I assumed had to do with the fact it was trying to compare the
>string 'YES' with the boolean value 'true' and coming up short. Now that I
>change the extends to grab the extra functions though, I am still getting
>the error above. It is not the most descriptive as to where the problem is
>....
The formatting of the variables might have that effect (I'll have to
look at why the comparison logic seeing them as different, but the
output format logic does not). If you think that is the case, you
could handle it a few different ways.
1) Use number format (boolean values can also be bit... 0/1):
<cfset assertEquals("message", NumberFormat( var1 ), NumberFormat(
var2 ) ) />
2) Use yes/no format:
<cfset assertEquals("message", YesNoFormat( var1 ), YesNoFormat( var2 ) ) />
3) Use assertEqualsBoolean form the extended TestCase class like you
are doing, just make sure to extend TestCaseExtra, not just TestCase
Or your fourth option - and I think this is probably what you will want to do:
4) use assertTrue:
<cfset assertEquals("message", var1 ) />
For example if you wanted to test that the "isSomthing()" method returns true:
<cfset assertTrue("Is somthing returned false", myCFC.isSomthing() ) />
Or if it should return false:
<cfset assertFalse("Is somthing returned true", myCFC.isSomthing() ) />
Hope that helps
--
Rob Blackburn
http://www.rbdev.net
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225295
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54