-
Notifications
You must be signed in to change notification settings - Fork 14
Using the Testing Framework
The WorkflowTestBase
class is an abstract base class that contains functionality to set up and configure the testing framework. All test classes must inherit from this base class. This example uses test attributes for MSTest to define a test class and the test initialization and clean-up methods:
[TestClass]
public class MyWorkflowTest : WorkflowTestBase
{
[TestInitialize]
public void TestInitialize()
{
Initialize("../../../../LogicAppUnit.Samples.LogicApps", "my-test-workflow");
}
[ClassCleanup]
public static void CleanResources()
{
Close();
}
}
The Initialize()
method is used to configure a workflow for testing. The path to the Logic App's root folder and the name of the workflow are passed as parameters. The actions performed by this method to prepare the workflow for testing are described in later sections.
The Close()
method is used to free up the resources used by the testing framework, once all tests in the test class have completed.
Once the WorkflowTestBase
class has been configured in the test class, the next step is to write the tests. A popular approach is to split the test into three parts, based on the AAA (Arrange, Act, Assert) pattern:
- Home
- Using the Testing Framework
- Test Configuration
- Azurite
- Local Settings File
- Test Execution Logs
- Stateless Workflows
- Handling Workflow Dependencies
- Fluent API
- Automated testing using a DevOps pipeline
- Summary of Test Configuration Options
-
Example Mock Requests and Responses
- Call a Local Function action
- Invoke Workflow action
- Built-In Connectors:
- Service Bus
- SMTP
- Storage Account
- SQL Server