I'm not certain the answer to your question, but wanted to make sure you know about the MXUnit list. I suspect you might have better luck getting an answer over there.
http://groups.google.com/group/mxunit (I would have also expected the test to fail, based upon what you've posted.) On Fri, Oct 7, 2011 at 2:13 PM, Bobby Hartsfield <[email protected]>wrote: > > Sounds like an odd request right? lol > > So I have a method that I have written some unit tests for. What I want to > add is a test that tests missing arguments. There are two arguments in my > method and both are required so I wanted a test for passing no arguments. > > This is what I tried: > > > > try > > { > > local.result = > instance.myService.meyMethod(); > > fail(); > > } > > catch(Application e) { } > > > > > > The above test passed. I THOUGHT the fail() was going to ensure that if > anyone came along and made the arguments not required that the test would > fail but the catch appears to be catching that as well... > > For instance, I tried this. > > > > > > try > > { > > local.result = 1; > > fail(); > > } > > catch(Application e) { } > > > > > > That test still passes... > > > > What I also thought was odd was that the exception type thrown by calling > my > method with no arguments was not the missingArgument type, it was > application. I'm assuming that application type is simply catching whatever > fail () is doing as well as my missing argument error and there for hitting > the catch. > > > > Does anyone know a solution to make this work as expected? > > > > I am on CF 8.0.1 by the way and running mxUnit 2.0.3 > > > > Thanks. > > > > > > .:.:.:.:.:.:.:.:.:.:.:.:. > > Bobby Hartsfield > > http://acoderslife.com > > http://cf4em.com > > > > > > > > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:348001 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

