This page last changed on Aug 03, 2006 by rprouse.

TestSequenceAttribute allows you to indicate the order in which tests will be executed within a test class decorated with the ProcessTestFixture attribute. Note that TestSequenceAttribute will not work on classes decorated with any other test fixture attribute.

TestSequenceAttribute example:

Unable to find source-code formatter for language: cs. Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml
[ProcessTestFixture]
   public class CheckTestSequences
   {
      int i = 0;

      [Test]
      [TestSequence( 2 )]
      public void Test2()
      {
         Assert.AreEqual( 2, i++ );
      }

      [Test]
      [TestSequence( 1 )]
      public void Test1()
      {
         Assert.AreEqual( 1, i++ );
      }

      [Test]
      [TestSequence( 0 )]
      public void Test0()
      {
         Assert.AreEqual( 0, i++ );
      }
   }
Document generated by Confluence on Jun 11, 2007 11:56