Hi,I've got a couple of queries on MXunit and asserts. I've have the following code, 1 cfc and 1 test cfc which I invoke via my browser: http://127.0.0.1:8500/mxunit/tests/mycomponenttest.cfc?method=testaddmycomponent.cfc<cfcomponent><cffunction name="add" access="public" returntype="numeric">
<cfargument name="num1"><cfargument name="num2"><cfreturn num1+num2></cffunction></cfcomponent>mycomponentTEST.cfc<cfcomponent displayname="mxunit.framework.MyComponentTest" extends="mxunit.framework.TestCase"><cffunction name="testAdd" access="remote" returntype="void"><cfinvoke component = "mycomponent" method = "add" returnVariable = "result" ><cfinvokeargument name="num1" value="3"><cfinvokeargument name="num2" value="3"></cfinvoke><cfset asserttrue (3,"error")></cffunction>
</cfcomponent>When I run mycomponentTEST.cfc I get a blank page back.How come? Is my asserttrue incorrect? Any pointers much appreciated.
I've tried replacing the assert with <cfset assertequals(1,2)> and get this :The web site you are accessing has experienced an unexpected error.--
Please contact the website administrator.
The following information is meant for the website developer for debugging purposes. Error Occurred While Processing Request
:: Expected [1] BUT RECEIVED [2]. These values should be the same.
The error occurred in C:\ColdFusion8\wwwroot\mxunit\framework\Assert.cfc: line 176
Called from C:\ColdFusion8\wwwroot\mxunit\framework\Assert.cfc: line 267
Called from C:\ColdFusion8\wwwroot\mxunit\tests\mycomponenttest.cfc: line 11 174 : <cfset variables.actual = arguments.actual> 175 : </cfif> 176 : <cfthrow type="mxunit.exception.AssertionFailedError" message="#arguments.message#:: Expected [#getStringValue(arguments.expected,arguments.caseSensitive)#] BUT RECEIVED [#getStringValue(arguments.actual,arguments.caseSensitive)#]. These values should be the same. " /> 177 : </cffunction> 178 :
You received this message because you are subscribed to the Google Groups "mxunit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/mxunit/-/DBN2Accby4AJ.
To post to this group, send email to mxu...@googlegroups.com.
To unsubscribe from this group, send email to mxunit+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mxunit?hl=en.
To view this discussion on the web visit https://groups.google.com/d/msg/mxunit/-/hOUlQJ-kc7cJ.