-
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.
- Loading branch information
Showing
4 changed files
with
51 additions
and
34 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using DotNetSampleApp.Services; | ||
using Fauna; | ||
using NUnit.Framework; | ||
|
||
namespace DotNetSampleApp.Tests; | ||
|
||
[SetUpFixture] | ||
public class TestSetup | ||
{ | ||
public static string Secret = ""; | ||
|
||
[OneTimeSetUp] | ||
public void SetupOnce() | ||
{ | ||
if (Environment.GetEnvironmentVariable("FAUNA_SECRET") == null) | ||
{ | ||
var c = new Client(new Configuration("secret") | ||
{ | ||
Endpoint = new Uri("http://localhost:8443"), | ||
}); | ||
Secret = c.QueryAsync<string>(Query.FQL($$""" | ||
let k = Key.create({role: 'admin', database: 'ECommerceDotnet'}) | ||
k.secret | ||
""")).Result.Data; | ||
} | ||
else | ||
{ | ||
Secret = Environment.GetEnvironmentVariable("FAUNA_SECRET")!; | ||
} | ||
|
||
var client = new Client(new Configuration(Secret) | ||
{ | ||
Endpoint = new Uri("http://localhost:8443"), | ||
}); | ||
SeedService.Init(client); | ||
} | ||
|
||
} |