Defining Additional Test Methods

A test method in .NET is a public (non virtual) method that has the SilkPerformer.TestMethod attribute applied to it. Each call to a test method is scripted as a DotNetCallMethod function in the current transaction. It's possible to have multiple test methods in a single transaction.

Defining a Test Method

C# Code BDL Script
[VirtualUser("Vuser1")]
[Transaction(Etranstype.TRANSTYPE_MAIN)]
  public void TMain()
  {
  }

  [TestMethod]
  public void Method1()
  {
  }

  [TestMethod]
  public void Method2()
  {
  }
dcluser
  transaction TMain
  begin
    DotNetCallMethod(hVuser1,"TMain");
    DotNetCallMethod(hVuser1,"Method1");
    DotNetCallMethod(hVuser1,"Method2");
  end;

The two test methods, Method1 and Method2, will be called in the current transaction. The current transaction is the transaction method that is declared previous to these test methods in the .NET code.