Test Fixture (NUnit 2.0)
This is the attribute that marks a class that contains test methods.
This attribute is contained in the NUnit.Framework namespace. In
previous versions of NUnit the programmer was required to inherit
from a class called TestCase . This is more flexible because it allows
a TestFixture attribute to be put on any class.
Note: There are a few restrictions. The class must have a default
constructor. The class must also be a publicly exported type or
the program that dynamically builds suites will not see it.
Example:
namespace NUnit.Tests
{
using System;
using NUnit.Framework;
[TestFixture]
public class SuccessTests
{
// ...
}
}
Imports System
Imports Nunit.Framework
Namespace Nunit.Tests
<TestFixture()> Public Class SuccessTests
' ...
End Class
End Namespace
#using <Nunit.Framework.dll>
using namespace System;
using namespace NUnit::Framework;
namespace NUnitTests
{
[TestFixture]
public __gc class SuccessTests
{
// ...
};
}
#include "cppsample.h"
namespace NUnitTests {
// ...
}
package NUnit.Tests;
import System.*;
import NUnit.Framework.TestFixture;
/** @attribute NUnit.Framework.TestFixture() */
public class SuccessTests
{
// ...
}
|
|