Skip to content

Commit

Permalink
Also check for api key in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SWH-Relewise committed Sep 26, 2023
1 parent 6996d68 commit 212f274
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,12 @@ public void ApiKeySetOnClientButNeverGlobally()

ServiceProvider provider = serviceCollection.BuildServiceProvider();
var tracker = provider.GetService<ITracker>();
IRelewiseClientFactory factory = provider.GetRequiredService<IRelewiseClientFactory>();
RelewiseClientOptions trackerOptions = factory.GetOptions<ITracker>();

Assert.IsNotNull(tracker);
Assert.AreEqual(Guid.Parse("6D9361AA-A23D-4BF2-A818-5ABA792E2102"), trackerOptions.DatasetId);
Assert.AreEqual("r4FqfMqtiZjJmoN", trackerOptions.ApiKey);
}

[Test]
Expand All @@ -112,9 +116,12 @@ public void ReadFromConfiguration_OnlySetOnClient()

ServiceProvider provider = serviceCollection.BuildServiceProvider();
var tracker = provider.GetService<ITracker>();
IRelewiseClientFactory factory = provider.GetRequiredService<IRelewiseClientFactory>();
RelewiseClientOptions trackerOptions = factory.GetOptions<ITracker>();

Assert.IsNotNull(tracker);
Assert.AreEqual(Guid.Parse("B57CB490-1556-4F06-AA26-96451533A9B8"), tracker.DatasetId);
Assert.AreEqual(Guid.Parse("B57CB490-1556-4F06-AA26-96451533A9B8"), trackerOptions.DatasetId);
Assert.AreEqual("61ce444b6e7c4f", trackerOptions.ApiKey);
}

[Test]
Expand Down

0 comments on commit 212f274

Please sign in to comment.