I have worked on a solution, here it is. Would it be possible to
integrate this in NUnit itself?
[AttributeUsage(AttributeTargets.Method, AllowMultiple=false)]
public class UnderDevelopmentAttribute : PropertyAttribute
{
public UnderDevelopmentAttribute()
: base("UnderDevelopment")
{ }
}
[DllImport("kernel32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
public static extern bool IsDebuggerPresent();
public static bool IsDebuggerAttached
{
get
{
return System.Diagnostics.Debugger.IsAttached /* managed */
|| IsDebuggerPresent() /* unmanged */;
}
}
[SetUp]
public void Setup()
{
if (TestContext.Properties.Contains("UnderDevelopment"))
{
if (!IsDebuggerAttached)
Assert.Ignore("under development");
}
}
--
You received this bug notification because you are a member of NUnit
Core Developers, which is the registrant for NUnit Framework.
https://bugs.launchpad.net/bugs/777810
Title:
explicit and ignore
Status in NUnit Test Framework:
New
Bug description:
First the problem:
We make a test, that could not be satisfied up to now, because the
implementation of the functionality is not ready. We give him the attribute
explicit, so the developer can run the test while he implements the
functionality. But for the person who looks at the tests, he didn't see the
test. So we make a empty copy of the test and give hin the attribute ignore.
If we give the test both attributes, explicit and ignore, the test is not
runable under the gui.
A possibility would be that ignored tests can be run if a special option is
set (perhaps on the tab for categories or command line).
This would be a very nice feature!
_______________________________________________
Mailing list: https://launchpad.net/~nunit-core
Post to : [email protected]
Unsubscribe : https://launchpad.net/~nunit-core
More help : https://help.launchpad.net/ListHelp