-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
45 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
namespace Replicate.IntegrationTests; | ||
|
||
public partial class Tests | ||
{ | ||
[TestMethod] | ||
public async Task Account() | ||
{ | ||
using var api = GetAuthorizedApi(); | ||
|
||
var response = await api.AccountGetAsync(); | ||
|
||
response.Should().NotBeNull(); | ||
response.Type.HasValue.Should().BeTrue(); | ||
} | ||
} |
10 changes: 2 additions & 8 deletions
10
src/tests/Replicate.IntegrationTests/Tests.CreatePrediction.cs
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,17 @@ | ||
namespace Replicate.IntegrationTests; | ||
|
||
[TestClass] | ||
public partial class Tests | ||
{ | ||
public static ReplicateApi GetAuthorizedApi() | ||
{ | ||
var apiKey = | ||
Environment.GetEnvironmentVariable("REPLICATE_API_KEY") ?? | ||
throw new AssertInconclusiveException("REPLICATE_API_KEY environment variable is not found."); | ||
|
||
var api = new ReplicateApi(); | ||
api.AuthorizeUsingBearer(apiKey); | ||
|
||
return api; | ||
} | ||
} |