Watts-Energy/Watts.Azure

Unit tests and refactoring of AzureDataFactoryCopy

kfaerk opened this issue · 0 comments

There are currently no unit tests of the data factory copy activity, only a few integration tests.
Add unit tests that verify expected behaviour of AzureDataFactoryCopy (https://github.com/Watts-Energy/Watts.Azure/blob/development/Watts.Azure.Common/DataFactory/Copy/AzureDataFactoryCopy.cs).

To do that, the DataFactoryManagementClient should be wrapped somehow, so that unit tests can inject a mock instead of working against the concrete implementation.
Important things to test:

  • When the timeout period is exceeded, MonitorStatusUntilDone finishes.
  • When the slice State becomes Failed or Completed, MonitorStatusUntilDone finishes
  • When an exception occurs in MonitorStatusUntilDone, RetryAuthentication is invoked up to a maximum of 3 times.
  • General testing of exceptions not being swallowed, but rethrown.