# Friday, April 30, 2004

MbUnit features a new test decorator that asserts that the duration of the test is less than some values. DurationAttribute usage is quite intuitive as shown in the example below:

[TestFixture]
public class DurationAttributeTest
{
    [Test]
    [Duration(1,"This method succeeds (has 1 second to succeed")]
    public void EmptyMethod()
    {}

   [Test]
   [Duration(0,"This method will fail because it will  run in more that 0 seconds!")]
   public void EmptyMethodFails()
   {
      Console.WriteLine("Take your time");
   }
}
posted on Friday, April 30, 2004 2:47:00 PM (Pacific Daylight Time, UTC-07:00)  #    Comments [3]
Tracked by:
"rebecca smyth" (online) [Trackback]
"christian dating man" (online) [Trackback]