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")
{ }
}
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");
}
}
I have worked on a solution, here it is. Would it be possible to integrate this in NUnit itself?
[AttributeUsage (AttributeTarge ts.Method, AllowMultiple= false)] tAttribute : PropertyAttribute tAttribute( ) lopment" )
public class UnderDevelopmen
{
public UnderDevelopmen
: base("UnderDeve
{ }
}
[DllImport( "kernel32. dll", CharSet = CharSet.Auto, ExactSpelling = true)] nt();
public static extern bool IsDebuggerPrese
public static bool IsDebuggerAttached Diagnostics. Debugger. IsAttached /* managed */
{
get
{
return System.
|| IsDebuggerPresent() /* unmanged */;
}
}
[SetUp] Properties. Contains( "UnderDevelopme nt")) ached) Ignore( "under development");
public void Setup()
{
if (TestContext.
{
if (!IsDebuggerAtt
Assert.
}
}