Skip to content

Commit

Permalink
Clean-up of VisualStudio warnings from latest C# language features
Browse files Browse the repository at this point in the history
  • Loading branch information
JJBussert committed May 4, 2021
1 parent b0de716 commit 289075a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/E13.Common.Nunit.Api/BaseApiFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ namespace E13.Common.Nunit.Api
{
public class BaseApiFixture : LaunchSettingsFixture
{
private TestServer Server { get; set; }
private string BaseUrl { get; }
private TestServer? Server { get; set; }
private string? BaseUrl { get; }
private string ProjectName { get; }
private Func<IWebHostBuilder> BuilderFunc { get; }

Expand All @@ -21,9 +21,9 @@ public BaseApiFixture(string projectName, Func<IWebHostBuilder> builderFunc)
BuilderFunc = builderFunc;
}

private static HttpClient _singleton;
private static HttpClient? _singleton;

public HttpClient GetHttpClient()
public HttpClient? GetHttpClient()
{
// only init a single HttpClient
if (_singleton != null)
Expand All @@ -39,7 +39,7 @@ public HttpClient GetHttpClient()
Directory.GetCurrentDirectory().ParentSiblingDirectory(ProjectName),
BuilderFunc());

_singleton = Server.CreateClient();
_singleton = Server?.CreateClient();

return _singleton;
}
Expand Down
4 changes: 2 additions & 2 deletions src/E13.Common.Nunit.Api/Extensions/HttpClientExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ namespace System.Net.Http
{
public static class HttpClientExtensions
{
private static readonly string TestUser = Environment.GetEnvironmentVariable("TokenForAAD_TestUser");
private static readonly string TestPass = Environment.GetEnvironmentVariable("TokenForAAD_TestPass");
private static readonly string? TestUser = Environment.GetEnvironmentVariable("TokenForAAD_TestUser");
private static readonly string? TestPass = Environment.GetEnvironmentVariable("TokenForAAD_TestPass");

#pragma warning disable CA1707 // Identifiers should not contain underscores - this is an exception because it is used primarily in unit tests
public static void TokenForAAD_TestEnabled(this HttpClient client, string[] apiScopes)
Expand Down

0 comments on commit 289075a

Please sign in to comment.