mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-15 03:18:07 +00:00
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:
@ -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);
|
||||
|
Reference in New Issue
Block a user