I would like to test an app that uses the Clipboard (WindowsForms) and I need the Clipboard in my unit tests also. In order to use it, it should run in STA mode, but since the NUnit TestFixture
does not have a main method, I don't know where/how to annotate it.
If you are using nunit 2.5+, you can use the new The RequiresSTAAttribute
at class
[TestFixture, RequiresSTA]
or assembly level.
[assembly:RequiresSTA]
No need for config file. check: http://www.nunit.org/index.php?p=requiresSTA&r=2.5