dotnet-sdk/test/Shared
Ryan Nowak 1e23165d1c
Unit testability for timers and reminders (#622)
* 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
2021-03-19 10:00:53 -07:00
..
AppCallbackClient.cs Fix pattern for tests that use HttpClient (#589) 2021-02-16 10:09:34 -08:00
GrpcUtils.cs Merge into release (#565) 2021-01-27 14:46:35 -08:00
TestClient.cs Unit testability for timers and reminders (#622) 2021-03-19 10:00:53 -07:00