diff --git a/tests/HaveIBeenPwned.Client.AcceptanceTests/GlobalUsings.cs b/tests/HaveIBeenPwned.Client.AcceptanceTests/GlobalUsings.cs index 809f9f1..b2511e4 100644 --- a/tests/HaveIBeenPwned.Client.AcceptanceTests/GlobalUsings.cs +++ b/tests/HaveIBeenPwned.Client.AcceptanceTests/GlobalUsings.cs @@ -2,3 +2,6 @@ // Licensed under the MIT License. global using Xunit; + +global using HaveIBeenPwned.Client.Extensions; +global using HaveIBeenPwned.Client.Options; \ No newline at end of file diff --git a/tests/HaveIBeenPwned.Client.AcceptanceTests/PwnedClientTests.cs b/tests/HaveIBeenPwned.Client.AcceptanceTests/PwnedClientTests.cs new file mode 100644 index 0000000..a81305a --- /dev/null +++ b/tests/HaveIBeenPwned.Client.AcceptanceTests/PwnedClientTests.cs @@ -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); + } +}