mirror of https://github.com/dapr/dotnet-sdk.git
* Unit testability for timers and reminders Fixes: #575 This change adds abstractions for Actors timer and reminder functionality, making them possible to unit test. Previously these features were wired from the Actor class directly into the client functionality, and there was no way for a user of actors to write their own tests when they include this functionality in their code. Making this work required a lot of munging of basic data types because we need to *extract* a layer of functionality into a testable API. I also added a helper method for tests to create an actor host with mocks attached. We'll likely need to do more in the future to support testability for actors. I started this process by adding some "unit test" unit tests. The only way to test that you can test is by testing :). ---- Additionally I added E2E tests for actors timers and reminders and improved some of the existing test functionality. The big investment here is to change the layering of tests to ensure that we only need to start one instance of the test app at a time. Previously we'd start and stop the test app as part of the only test we have. Adding more tests means we want to avoid this overhead when possible. This is specifically a challenge for actors since the assocation of an actor type to an app id is **global state**. We want to keep the app process we're using for tests long-lived to avoid classic distributed systems problems (like the host going away) inside our tests. * Dedupe code for initializing defaults |
||
|---|---|---|
| .. | ||
| AppCallbackClient.cs | ||
| GrpcUtils.cs | ||
| TestClient.cs | ||