On Fri, Nov 2, 2012 at 5:57 AM, Dan <root
...@gmail.com> wrote:
> Many thanks Mark. I got it working as you pointed out.
> On Thursday, October 25, 2012 8:01:58 PM UTC+1, Marc Esher wrote:
>> Hey Dan,
>> Sorry for the late reply.
>> The problem is that you're running the test incorrectly. It should be run
>> like so:
>> http://127.0.0.1:8500/mxunit/**tests/mycomponenttest.cfc?**
>> method=runTestRemote<http://127.0.0.1:8500/mxunit/tests/mycomponenttest.cfc?method=runTest...>
>> That will run all tests in your TestCase.
>> If you want to run a single test method in a testcase, you'll do this:
>> http://127.0.0.1:8500/mxunit/**tests/mycomponenttest.cfc?**
>> method=runTestRemote&**testMethod=testAdd<http://127.0.0.1:8500/mxunit/tests/mycomponenttest.cfc?method=runTest...>
>> Marc
>> On Mon, Oct 22, 2012 at 9:47 AM, Dan <roo...@gmail.com> wrote:
>>> 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=**
>>> testadd<http://127.0.0.1:8500/mxunit/akaritests/mycomponenttest.cfc?method=te...>
>>> *mycomponent.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<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 <http://groups.google.com/group/mxunit?hl=en>.
>> --
> 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/-/hOUlQJ-kc7cJ.
> To post to this group, send email to mxunit@googlegroups.com.
> To unsubscribe from this group, send email to
> mxunit+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/mxunit?hl=en.