Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
some basic mxunit queries
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Dan  
View profile  
 More options Oct 22 2012, 9:47 am
From: Dan <root...@gmail.com>
Date: Mon, 22 Oct 2012 06:47:26 -0700 (PDT)
Local: Mon, Oct 22 2012 9:47 am
Subject: some basic mxunit queries

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 must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marc Esher  
View profile  
 More options Oct 25 2012, 3:01 pm
From: Marc Esher <marc.es...@gmail.com>
Date: Thu, 25 Oct 2012 15:01:54 -0400
Local: Thurs, Oct 25 2012 3:01 pm
Subject: Re: [mxunit:3737] some basic mxunit queries

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=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=runTest...

Marc


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dan  
View profile  
 More options Nov 2 2012, 5:57 am
From: Dan <root...@gmail.com>
Date: Fri, 2 Nov 2012 02:57:32 -0700 (PDT)
Local: Fri, Nov 2 2012 5:57 am
Subject: Re: [mxunit:3737] some basic mxunit queries

Many thanks Mark. I got it working as you pointed out.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marc Esher  
View profile  
 More options Nov 2 2012, 8:20 am
From: Marc Esher <marc.es...@gmail.com>
Date: Fri, 2 Nov 2012 08:20:48 -0400
Local: Fri, Nov 2 2012 8:20 am
Subject: Re: [mxunit:3740] some basic mxunit queries

Good to hear it, Dan. Happy testing.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »