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"); } }
Page rendered at Thursday, July 24, 2008 5:12:04 AM UTC
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.