Skip to content
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 azure-pipeline-PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ steps:
displayName: 'Use .NET 6.0 sdk'
inputs:
packageType: sdk
version: 6.0.402
version: 6.0.403
installationPath: $(Agent.ToolsDirectory)/dotnet
- script: echo Started restoring the source code
- task: DotNetCoreCLI@2
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ steps:
displayName: 'Use .NET 6.0 sdk'
inputs:
packageType: sdk
version: 6.0.402
version: 6.0.403
installationPath: $(Agent.ToolsDirectory)/dotnet
- script: echo Started restoring the source code
- task: DotNetCoreCLI@2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
using Microsoft.Extensions.Options;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;

namespace Xunit.Microsoft.DependencyInjection.ExampleTests.Services;

public class Calculator : ICalculator
{
private readonly Options _option;
private readonly ILogger<Calculator> _logger;

public Calculator(IOptions<Options> option)
=> _option = option.Value;
public Calculator(ILogger<Calculator> logger, IOptions<Options> option)
=> (_logger, _option) = (logger, option.Value);

public int Add(int x, int y)
=> (x + y) * _option.Rate;
{
var result = (x + y) * _option.Rate;
_logger.LogInformation("The result is {@Result}", result);
return result;
}
}
2 changes: 1 addition & 1 deletion src/Logging/OutputLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Except
}
else
{
_testOutputHelper.WriteLine($"{logLevel} - Category: {_categoryName} : {DateTime.Now}");
_testOutputHelper.WriteLine($"{logLevel} - Category: {_categoryName} : {state} :: {DateTime.Now}");
}
}
}