Convert agent_events to C# & add tests (#2032)

### Function implementation

Added implementation of `agent_events` function and some basic tests.

Fixed several issues encountered in `TestOperations`.

### Additional JsonConverter

The existing Python code for `agent_events` figures out which class to use only based upon the shape of the input, without a discriminator. I have added an additional `JsonConverter` named `SubclassConverter<T>` which will pick a subclass of `T` to deserialize into based upon what properties exist in the JSON.

### Enum helpers

Converted some enum helpers to extension methods to make them a bit more readable.
This commit is contained in:
George Pollard
2022-06-17 10:28:09 +12:00
committed by GitHub
parent cdec3c9e8d
commit 4ecd43fc0f
24 changed files with 1100 additions and 124 deletions

View File

@ -15,11 +15,11 @@ sealed class AzureStorage : IStorage {
var accountKey = Environment.GetEnvironmentVariable("AZURE_ACCOUNT_KEY");
if (accountName is null) {
throw new Exception("AZURE_ACCOUNT_NAME must be set in environment to run integration tests");
throw new Exception("AZURE_ACCOUNT_NAME must be set in environment to run integration tests (use --filter 'Category!=Integration' to skip them)");
}
if (accountKey is null) {
throw new Exception("AZURE_ACCOUNT_KEY must be set in environment to run integration tests");
throw new Exception("AZURE_ACCOUNT_KEY must be set in environment to run integration tests (use --filter 'Category!=Integration' to skip them)");
}
return new AzureStorage(accountName, accountKey);