Google Groups

Re: [nunit-discuss] Accessing Failure message or stack trace in TearDown


Naresh May 25, 2012 8:14 AM
Posted in group: NUnit-Discuss
Hello Charlie,

I looked into Action Attributes and as you said it is not useful in my scenario.

They take object of TestDetails type which gives some basic info about the test.

The other option, we are still using nunit 2.6. So I don't think I can go with that.

Thanks,
Naresh

On Fri, May 25, 2012 at 4:00 PM, Charlie Poole <nuni...@gmail.com> wrote:
Hi Naresh,

I'm travelling without a development machine, so I can't check it out
myself. Look at the docs for ActionAttributes and see what is passed
to the before and after methods. If my memory is correct, it's just
the object you created for the test, which is no help in this
situation.

Instead, we could pass the internal Test object, which contains a
pointer to your created object and also all the other info you want to
get. Unfortunately, I think this would require implementation in NUnit
3.0.

Charlie

On Fri, May 25, 2012 at 4:52 PM, Naresh Thandu <naresh...@gmail.com> wrote:
> Hello Charlie,
>
> Thanks for your response. I agree with your point.
>
> Can you advise me from where I can get the complete test info.
>
> Thanks,
> Naresh
>
>
> On Fri, May 25, 2012 at 3:45 PM, Charlie Poole <nuni...@gmail.com> wrote:
>>
>> Hi Naresh,
>>
>> It seems like a slippery slope to start giving the test too much info
>> about it's context. This may encourage very complex teardowns, which -
>> I think - would be undesireable.
>>
>> I would be in favor of making full info about the test to a special
>> attribute (Action Attribute) to be applied to tests. My reasoning is
>> that when you are writing an ActionAttribute, you are creating a
>> simple extension to NUnit itself but when you are writing TearDown
>> code, you are in the world of the test and are subject to a certain
>> degree of sandboxing.
>>
>> Charlie
>>
>> On Fri, May 25, 2012 at 10:07 AM, Naresh <naresh...@gmail.com> wrote:
>> > Hello,
>> >
>> > Is there any way to access the test failure reason in TearDown.
>> >
>> > I thought of using TestContext object, but it tells you only the status
>> > and
>> > state. It will not give any info on the failure reason.
>> >
>> > Thanks,
>> > Naresh
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "NUnit-Discuss" group.
>> > To view this discussion on the web visit
>> > https://groups.google.com/d/msg/nunit-discuss/-/SCjVZ0TF60sJ.
>> > To post to this group, send email to nunit-...@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> > nunit-discus...@googlegroups.com.
>> > For more options, visit this group at
>> > http://groups.google.com/group/nunit-discuss?hl=en.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "NUnit-Discuss" group.
>> To post to this group, send email to nunit-...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> nunit-discus...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/nunit-discuss?hl=en.
>>
>
>
>
> --
> Regards,
> Naresh Thandu,
> +91-9916710222
>
> --
> You received this message because you are subscribed to the Google Groups
> "NUnit-Discuss" group.
> To post to this group, send email to nunit-...@googlegroups.com.
> To unsubscribe from this group, send email to
> nunit-discus...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/nunit-discuss?hl=en.

--
You received this message because you are subscribed to the Google Groups "NUnit-Discuss" group.
To post to this group, send email to nunit-...@googlegroups.com.
To unsubscribe from this group, send email to nunit-discus...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nunit-discuss?hl=en.




--
Regards,
Naresh Thandu,
+91-9916710222