Re: Assume

"Daniel M. Pomerantz" <[email protected]>
Newsgroups gmane.comp.windows.dotnet.nunit.devel
Message-ID <[email protected]>
That makes perfect sense!  I forgot about NUnit handling the exception 
and was trying to come up with a way that you could implement it 
yourself...and actually you can.  Truth be told though NUnice should be 
able to do that, and I like the concept.  I can't think of a particular 
situation where I would use it, but I'm sure it could come up!  For the 
record, as I'm sure you know, you can implement ExpectedException with 
your own Try/Catch, and that was the pattern I was using.  One good 
thing about rolling your own ExpectedException, you can pinpoint/direct 
exactly which line of code throws the exception with your own 
try/catch.  ExpectedException cannot do that.

I see this as sort of the [Explicit] attribute with parameters:)

dmp

Kelly Anderson wrote:
> On Fri, Feb 15, 2008 at 1:44 PM, Daniel M. Pomerantz
> <[email protected]> wrote:
>   
>> How about anything inside of Assume throws an AssumptionException.
>>     
>
> Right. That's what I proposed. The thing is that I think NUnit should
> consume the AssumptionException. If you can think of a way that NUnit
> should process that differently than a successful Test, let's talk
> about it. I see it as similar to ExpectedException throwing an
> exception, and that being seen as a success.
>
>   
>>  Inside of your code, wrap your method inside of a try that catches
>>  AssumptionExceptions and then swallows it.  That way, you can succeed
>>  even if the assumptions fail?
>>     
>
> I don't think you want to be catching the AssumptionException yourself
> generally... think of ExpectedException as the model for how this
> could work.
>
> -Kelly
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> nunit-developer mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/nunit-developer
>
>
>   

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.