-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update: update readme.md
- Loading branch information
Showing
7 changed files
with
109 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using Moq; | ||
|
||
namespace dotta.Net.Test; | ||
|
||
public class DottaTest | ||
{ | ||
[Fact] | ||
public void Test_InstantiateDotta() | ||
{ | ||
// Arrange | ||
var mockHttpClient = new Mock<HttpClient>(); | ||
var dottaService = new Dotta(new DottaOptions { | ||
ApiKey = "ABSCDE" | ||
}); | ||
|
||
// Act | ||
var apiKey = dottaService.ApiKey; | ||
var environment = dottaService.Environment; | ||
var prodBaseUrl = dottaService.BaseUrlProduction; | ||
var sandboxBaseUrl = dottaService.BaseUrlSandbox; | ||
|
||
// Assert | ||
Assert.Equal("ABCDE", apiKey); | ||
Assert.Equal(DottaEnvironment.Sandbox, environment); | ||
Assert.Equal("https://apps.securedrecords.com/dotta-biometrics/api/", prodBaseUrl); | ||
Assert.Equal("https://apps.securedrecords.com/DevDottaBiometrics/api/", sandboxBaseUrl); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System.Net.Http; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
namespace dotta.Net | ||
{ | ||
public static class ServiceProvider | ||
{ | ||
public static IServiceCollection AddDotta(this IServiceCollection services, DottaServiceOptions options) | ||
{ | ||
services.AddScoped<Dotta>((serviceProvider) => | ||
{ | ||
var httpClientFactory = serviceProvider.GetRequiredService<IHttpClientFactory>(); | ||
var httpClient = httpClientFactory.CreateClient(); | ||
return new Dotta(new DottaOptions | ||
{ | ||
ApiKey = options.ApiKey, | ||
BaseUrlProduction = options.BaseUrlProduction, | ||
BaseUrlSandbox = options.BaseUrlSandbox, | ||
Environment = options.Environment, | ||
HttpClient = httpClient | ||
}); | ||
}); | ||
|
||
return services; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters