Understanding unit testing in Orleans
In this section, we will see how to do unit testing on Orleans grains and ensure they are working fine. Orleans has a NuGet package called Microsoft.Orleans.TestingHost
, which can be used to create an in-memory cluster with two silos by default to test your grains. Let's now, step by step, create the unit test project and add tests to test the Grains
output. Orleans grains are in many ways their own little domains and the goal of unit testing is to make sure each of the grains as a unit behaves correctly.
Step 1: Create the unit test project:
- Add a unit test project to your solution using the xUnit Test Project template as shown here:
- Name the unit test project
Distel.UnitTests
:
Step 2: Install the TestingHost NuGet package and configure the silo:
- Install the
Microsoft...