Here's the real code for reference:

        [Test]
        public void should_throw_exception_for_null_action()
        {
            Assert.Throws(typeof(System.ArgumentNullException), ()=>
_calculator.PerformAction(null));
        }



        void ICalculator.PerformAction(IAction action)
        {
            if (action == null) return;

            IOperationAction operationAction = action as
IOperationAction;
            if (operationAction != null)
                if (_actions.Count == 0)
                    return;

            _actions.Add(action);
        }


So I guess I'm currently not using the generic version. I'll try later
today to get another build and try it out and I'll also try it with
the generic version and see if that fixes it (seems cleaner anyway) .


Thanks,

Dan Lash


On Nov 17, 5:23 am, wheelibin <[EMAIL PROTECTED]> wrote:
> Hi
>
> I've tried the latest build as suggested and that has fixed the
> problem for me.
> I was using that exact overload you mentioned.
>
> Thanks very much for such a quick response.
>
> Jon
>
> On 15 Nov, 20:41, Dan Lash <[EMAIL PROTECTED]> wrote:
>
>
>
> > Thanks for checking into that Jeff, I'll take a look on Monday with
> > the new build.
>
> > From memory my test looks something like this:
>
> > [Test]
> > public void MyTest()
> > {
> >     Assert.Throws<ArgumentNullException>( () => myObj.Method(null) );
>
> > }
>
> > and the class has a method with some very simple code (that does not
> > yet throw the argument null exception).
>
> > public void Method(IParameter param)
> > {
> >     _parameters.Add(param);
>
> > }
>
> > I'll get you the real code once I get back on Monday.
>
> > Thanks again,
>
> > Dan Lash
>
> > On Nov 14, 8:37 pm, "Jeff Brown" <[EMAIL PROTECTED]> wrote:
>
> > > I did find a problem with unbounded recursion in the Assert.Throws(Type,
> > > Action).  That was causing a StackOverflowException.  It may explain your
> > > issue if you happened to be using this particular overload of 
> > > Assert.Throws.
>
> > > Download:http://ccnet.gallio.org/Distributables/GallioBundle-3.0.4.534-Setup-x......
>
> > > If this does not resolve your problem, then please try to provide me with
> > > some sample code that reproduces it.  I'm running out of ideas...
>
> > > Jeff.
>
> > > P.S.  After some more experimentation, I realized I had not actually found
> > > any problems with inner exceptions.  So I'm still puzzled by that one and
> > > will be waiting to hear back from the original reporter of the issue with
> > > more info.
>
> > > -----Original Message-----
> > > From: Jeff Brown [mailto:[EMAIL PROTECTED]
> > > Sent: Friday, November 14, 2008 2:48 PM
> > > To: '[email protected]'
> > > Subject: RE: MbUnit Re: Error using Assert.Throws
>
> > > Ah Ha!
> > > I found the bug.  Really stupid of me.  I also found another bug related 
> > > to
> > > inner exceptions (mentioned elsewhere).
>
> > > I'm writing some more tests and will push out a new build within the next
> > > hour or so.
>
> > > Thanks for bringing this to my attention!
> > > Jeff.
>
> > > -----Original Message-----
> > > From: [email protected] [mailto:[EMAIL PROTECTED] On
> > > Behalf Of Dan Lash
> > > Sent: Friday, November 14, 2008 12:04 PM
> > > To: MbUnit.User
> > > Subject: MbUnit Re: Error using Assert.Throws
>
> > > I just installed the 533 build as suggested and it looks like I'm
> > > experiencing the same problem with Assert.Throws<>:
>
> > >http://screencast.com/t/rxLsx4HjZq
>
> > > Is there anything I can do to fix this, or is it just a waiting game?
>
> > > Dan Lash
>
> > > On Nov 14, 1:36 pm, "Jeff Brown" <[EMAIL PROTECTED]> wrote:
> > > > The most likely cause here is a StackOverflowException.
> > > > It turns out that there was a bug in one of the internal routines used
> > > > by Assert.Throws.
>
> > > > This has been fixed and will be included in the upcoming v3.0.5 release.
>
> > > > Please try installing one of these nightly builds:
>
> > >http://ccnet.gallio.org/Distributables/GallioBundle-3.0.4.533-Setup-x...
> > > ://ccnet.gallio.org/Distributables/GallioBundle-3.0.4.533-Setup-x...
>
> > > > Jeff.
>
> > > > -----Original Message-----
> > > > From: [email protected] [mailto:[EMAIL PROTECTED]
> > > > On
>
> > > > Behalf Of wheelibin
> > > > Sent: Friday, November 14, 2008 4:13 AM
> > > > To: MbUnit.User
> > > > Subject: MbUnit Error using Assert.Throws
>
> > > > Hi
>
> > > > I'm new to TDD and MbUnit so if I've done something daft please forgive
> > > me.
>
> > > > I'm getting an error when using Assert.Throws in a test.
>
> > > > Gallio throws this error when I run the
> > > > test:http://www.flickr.com/photos/wheelibin/3028927227/sizes/o/
>
> > > > Can anyone please help me?  Is it something I'm doing wrong?
>
> > > > Thanks in advance anyone- Hide quoted text -
>
> > > > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MbUnit.User" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/MbUnitUser?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to