yup.  The non generic variant was the one with the bug (now fixed).

Should be all set.  :-)
-----Original Message-----
From: Dan Lash <[EMAIL PROTECTED]>
Date: Monday, Nov 17, 2008 8:42 am
Subject: MbUnit Re: Error using Assert.Throws
To: "MbUnit.User" <[email protected]>Reply-To: 
[email protected]


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 


--~--~---------~--~----~------------~-------~--~----~
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