MartinCostello.Logging.XUnit.v3
0.7.1
dotnet add package MartinCostello.Logging.XUnit.v3 --version 0.7.1
NuGet\Install-Package MartinCostello.Logging.XUnit.v3 -Version 0.7.1
<PackageReference Include="MartinCostello.Logging.XUnit.v3" Version="0.7.1" />
<PackageVersion Include="MartinCostello.Logging.XUnit.v3" Version="0.7.1" />
<PackageReference Include="MartinCostello.Logging.XUnit.v3" />
paket add MartinCostello.Logging.XUnit.v3 --version 0.7.1
#r "nuget: MartinCostello.Logging.XUnit.v3, 0.7.1"
#:package MartinCostello.Logging.XUnit.v3@0.7.1
#addin nuget:?package=MartinCostello.Logging.XUnit.v3&version=0.7.1
#tool nuget:?package=MartinCostello.Logging.XUnit.v3&version=0.7.1
xunit Logging
Introduction
MartinCostello.Logging.XUnit and MartinCostello.Logging.XUnit.v3 provide extensions to hook
into the ILogger infrastructure to output logs from your xunit tests to the test output.
Usage
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Xunit;
using Xunit.Abstractions; // For xunit v2 - not required for xunit v3
namespace MyApp.Calculator;
public class CalculatorTests(ITestOutputHelper outputHelper)
{
[Fact]
public void Calculator_Sums_Two_Integers()
{
// Arrange
using var serviceProvider = new ServiceCollection()
.AddLogging((builder) => builder.AddXUnit(outputHelper))
.AddSingleton<Calculator>()
.BuildServiceProvider();
var calculator = services.GetRequiredService<Calculator>();
// Act
int actual = calculator.Sum(1, 2);
// Assert
Assert.AreEqual(3, actual);
}
}
public sealed class Calculator(ILogger<Calculator> logger)
{
public int Sum(int x, int y)
{
int sum = x + y;
logger.LogInformation("The sum of {x} and {y} is {sum}.", x, y, sum);
return sum;
}
}
Feedback
Any feedback or issues can be added to the issues for this project in GitHub.
License
This project is licensed under the Apache 2.0 license.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Framework | net472 is compatible. net48 was computed. net481 was computed. |
-
.NETFramework 4.7.2
- Microsoft.Extensions.Logging (>= 8.0.1)
- xunit.v3.extensibility.core (>= 2.0.1)
-
net10.0
- Microsoft.Extensions.Logging (>= 10.0.0)
- xunit.v3.extensibility.core (>= 2.0.1)
-
net8.0
- Microsoft.Extensions.Logging (>= 8.0.1)
- xunit.v3.extensibility.core (>= 2.0.1)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on MartinCostello.Logging.XUnit.v3:
| Package | Downloads |
|---|---|
|
Xunit.DependencyInjection.Logging
Support Microsoft.Extensions.Logging to ITestOutputHelper. public void Configure(IServiceProvider provider) { XunitTestOutputLoggerProvider.Register(provider); } |
|
|
Redpoint.CloudFramework.Tests.Shared
Provides common types for unit testing with Redpoint.CloudFramework. |
|
|
MartinDrozdik.DDD.Testing
A library to support testing of websites using the MartinDrozdik.DDD packages. |
GitHub repositories (10)
Showing the top 10 popular GitHub repositories that depend on MartinCostello.Logging.XUnit.v3:
| Repository | Stars |
|---|---|
|
domaindrivendev/Swashbuckle.AspNetCore
Swagger tools for documenting API's built on ASP.NET Core
|
|
|
DuendeSoftware/products
The most flexible and standards-compliant OpenID Connect and OAuth 2.x framework for ASP.NET Core
|
|
|
tonybaloney/CSnakes
Embed Python in .NET
|
|
|
CommunityToolkit/Aspire
A community project with additional components and extensions for Aspire
|
|
|
martincostello/dotnet-minimal-api-integration-testing
An example of integration testing ASP.NET Core Minimal hosting and APIs
|
|
|
pengweiqhca/Xunit.DependencyInjection
Use Microsoft.Extensions.DependencyInjection to resolve xUnit test cases.
|
|
|
justeattakeaway/httpclient-interception
A .NET library for intercepting server-side HTTP requests
|
|
|
martincostello/sqllocaldb
SQL LocalDB Wrapper is a .NET library providing interop with the Microsoft SQL Server LocalDB Instance API
|
|
|
Jericho/StrongGrid
Strongly typed library for the entire SendGrid v3 API, including webhooks
|
|
|
RedpointGames/uet
UET (Unreal Engine Tool) makes building and testing Unreal Engine projects and plugins easy. It can distribute builds with BuildGraph, remotely execute automation tests on device and across multiple machines, handles fault tolerance and automatic retries and generally makes the whole experience of automating Unreal Engine a lot more pleasant.
|
See https://github.com/martincostello/xunit-logging/releases/tag/v0.7.1 for details.