chore: refactoring some code to introduce a common base class for all api classes

This commit is contained in:
Matthias Langhard
2021-05-21 22:13:04 +02:00
parent ac20e2e1d4
commit 89e7ce8449
34 changed files with 721 additions and 551 deletions

View File

@@ -9,12 +9,12 @@ namespace Novaloop.PaymoApi.Tests
{
public static class DependencyFactory
{
public static PaymoApiClient GeneratePaymoApiClient()
public static ApiClient GeneratePaymoApiClient()
{
return new PaymoApiClient(new HttpClient {BaseAddress = new Uri("https://app.paymoapp.com/")});
return new ApiClient(new HttpClient {BaseAddress = new Uri("https://app.paymoapp.com/")});
}
public static IOptions<PaymoApiOptions> GenerateOptions()
public static IOptions<ApiOptions> GenerateOptions()
{
var paymoToken = new ConfigurationBuilder()
.SetBasePath(AppContext.BaseDirectory)
@@ -28,7 +28,7 @@ namespace Novaloop.PaymoApi.Tests
throw new ArgumentException("Please set the environment variable 'PAYMOAPIINTEGRATIONTESTS__PAYMOTESTPROJECTTOKEN' with the token of your paymo test-project. Look inside Bitwarden if you work @ Novaloop.");
}
return Options.Create(new PaymoApiOptions {ApiToken = paymoToken});
return Options.Create(new ApiOptions {ApiToken = paymoToken});
}
}
}