I have found a work around, but I do not like it.
I am creating an assembly level fixture, but instead of using
FixtureSetUp attribute, I use my own, which sets the default timeout:
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false,
Inherited = true)]
public class AssemblyFixtureSetUpAttribute : FixtureSetUpAttribute
{
public AssemblyFixtureSetUpAttribute(int defaultTestCaseTimeout)
{
TestAssemblyExecutionParameters.DefaultTestCaseTimeout =
TimeSpan.FromSeconds(defaultTestCaseTimeout);
}
}
[AssemblyFixture]
public static class GlobalSetup
{
[AssemblyFixtureSetUpAttribute(20)]
public static void AssemblyInitialize()
{
}
}
Although, it works I do prefer something more straightforward.
Besides, it would be nice to be able to change the default test case
timeout per fixture as well as per assembly.
Thanks.
On Sep 13, 9:56 pm, Yann Trevin <[email protected]> wrote:
> For ref.http://code.google.com/p/mb-unit/issues/detail?id=726
>
> 2010/9/13 Yann Trevin <[email protected]>
>
> > Hi Mark,
>
> > I was about to suggest that you use [assembly:
> > DefaultTestCaseTimeout(x)]but it seems that this feature is broken :(
> > As far as I can see, the attribute is consumed after the test tree is
> > built, so that the new default timeout is not taken into account.
> > It should be relatively easy to fix by deferring the evaluation of the
> > value until it's really needed.
> > I'm going to open an issue for that.
>
> > What do you mean exactly by "from the configuration"?
>
> > Yann.
>
> > 2010/9/13 Mark Kharitonov <[email protected]>
>
> > Hi.
>
> >> I have a test fixture with many tests. I would like to change their
> >> default timeout from 10 mins to something else without having to
> >> attribute each test method with the TimeoutAttribute explicitly. Only
> >> those with a different timeout will be explicitly attributed.
>
> >> It would be nice to be able to do it from the configuration...
>
> >> Thanks.
>
> >> --
> >> 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]<mbunituser%[email protected]>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/mbunituser?hl=en.
--
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.