using System;
using Silk Performer;
namespace SPProject1
{
[VirtualUser("VUser")]
public class VUser
{
public VUser()
{
}
[Transaction(ETransactionType.TRANSTYPE_INIT)]
public void TInit()
{
/* You can add multiple TestAttribute attributes to each function defining parameters that can be accessed through Bdl.AttributeGet
Example of testcode: (Access bdl function through the static functions of the Bdl class Bdl.MeasureStart(...);
...
Bdl.MeasureStop(...);
*/
}
[Transaction(ETransactionType.TRANSTYPE_MAIN)]
public void TMain()
{
}
[Transaction(ETransactionType.TRANSTYPE_END)]
public void TEnd()
{
}
}
}
As you can see from the skeleton example above, there is a custom attribute called VirtualUser that can be applied to classes. This causes the Add-On's BDL Generation Engine to generate a virtual user definition. You can implement multiple classes that have the VirtualUser attribute applied. The VirtualUser attribute takes the name virtual user as a parameter.
The BDL Generation Engine then parses the methods of the Virtual User class for methods that have a Transaction attribute applied to them. The Transaction attribute takes as a first parameter the transaction type (Init, Main or End). You can only have one Init and one End transaction, but multiple Main transactions.
The Main transaction type takes a second parameter that indicates the number of times that the transaction is to be called during load tests (default: 1).