Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to apply an NUnit Attribute to An Assembly

According to the documentation you can apply the NUnit timeout attribute to an assembly:

The attribute may also be specified on a fixture or assembly, in which case it indicates the default timeout for any subordinate test cases.

The challenge I am running into is that they give no indication of how to apply the attribute to an assembly on that page or anywhere else I can find in the documentations.

I tried using [SetupFixture] and decorating that with the attribute but that did not seem to take. Has anyone had any success in making something like this work?

like image 793
Wyatt Barnett Avatar asked Nov 19 '14 16:11

Wyatt Barnett


1 Answers

To apply the Timeout attribute to an assembly, first add the directive using NUnit.Framework; to the assembly's AssemblyInfo.cs. Then add a line specifying the timeout:

[assembly: Timeout(1000)]
like image 105
hunch_hunch Avatar answered Sep 21 '22 09:09

hunch_hunch