Skip to content

Commit

Permalink
Merge pull request #41 from Lombiq/issue/OSOE-867
Browse files Browse the repository at this point in the history
OSOE-867: Addressing analyzer warnings
  • Loading branch information
Piedone authored Jun 11, 2024
2 parents 2e9d8b7 + 0181902 commit 9f1b5ee
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
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

0 comments on commit 9f1b5ee

Please sign in to comment.