Skip to content

Commit

Permalink
Test new API
Browse files Browse the repository at this point in the history
  • Loading branch information
IEvangelist committed Feb 13, 2024
1 parent 4f8444e commit e6e5748
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/HaveIBeenPwned.Client.AcceptanceTests/GlobalUsings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
// Licensed under the MIT License.

global using Xunit;

global using HaveIBeenPwned.Client.Extensions;
global using HaveIBeenPwned.Client.Options;
26 changes: 26 additions & 0 deletions tests/HaveIBeenPwned.Client.AcceptanceTests/PwnedClientTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright (c) David Pine. All rights reserved.
// Licensed under the MIT License.

namespace HaveIBeenPwned.Client.AcceptanceTests;

[Trait("Category", "AcceptanceTests")]
public class PwnedClientTests
{
private readonly IPwnedClient _pwnedClient;

public PwnedClientTests() =>
_pwnedClient = new PwnedClient(
Environment.GetEnvironmentVariable("HibpOptions__ApiKey")!);

[Fact]
public async Task GetSubscriptionStatusAsyncReturnsCorrectStatus()
{
var status =
await _pwnedClient.GetSubscriptionStatusAsync();

Assert.NotNull(status);

var actual = status.GetSubscriptionLevel();
Assert.Equal(HibpSubscriptionLevel.One, actual);
}
}

0 comments on commit e6e5748

Please sign in to comment.