Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSOE-867: Addressing analyzer warnings #41

Merged
merged 2 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Extensions/AutoMockerExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public static ListLoggerProvider MockLogging(this AutoMocker mocker)
{
var provider = new ListLoggerProvider();

mocker.Use<ILoggerFactory>(new LoggerFactory(new ILoggerProvider[] { provider }));
mocker.Use<ILoggerFactory>(new LoggerFactory([provider]));
mocker.EnsureResolver<LoggerResolver>();

return provider;
Expand Down
2 changes: 2 additions & 0 deletions Integration/Controllers/AutoMockerController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public AutoMockerController(AutoMocker mocker)

public void SetRequestUri(Uri uri)
{
if (!ModelState.IsValid) return;

HttpContext.Request.Host = HostString.FromUriComponent(uri);
HttpContext.Request.IsHttps = uri.Scheme.Equals("HTTPS", StringComparison.OrdinalIgnoreCase);

Expand Down
4 changes: 2 additions & 2 deletions Integration/Services/ListLogger.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
Expand All @@ -9,7 +9,7 @@ namespace Lombiq.Tests.Integration.Services;
public class ListLogger : ILogger
{
public string CategoryName { get; }
public IList<LogEntry> Logs { get; } = new List<LogEntry>();
public IList<LogEntry> Logs { get; } = [];

public ListLogger(string categoryName) => CategoryName = categoryName;

Expand Down