DotNetToolbox.FluentAssertions
8.0.3
See the version list below for details.
dotnet add package DotNetToolbox.FluentAssertions --version 8.0.3
NuGet\Install-Package DotNetToolbox.FluentAssertions -Version 8.0.3
<PackageReference Include="DotNetToolbox.FluentAssertions" Version="8.0.3" />
paket add DotNetToolbox.FluentAssertions --version 8.0.3
#r "nuget: DotNetToolbox.FluentAssertions, 8.0.3"
// Install DotNetToolbox.FluentAssertions as a Cake Addin #addin nuget:?package=DotNetToolbox.FluentAssertions&version=8.0.3 // Install DotNetToolbox.FluentAssertions as a Cake Tool #tool nuget:?package=DotNetToolbox.FluentAssertions&version=8.0.3
TestUtilities (DotNetToolbox.TestUtilities)
Introduction
DotNetToolbox.FluentAssertions
is an extension of FluentAssertions, tailored for .NET 8, aimed at providing specialized assertion capabilities for logging components in .NET applications. It enhances test readability and maintainability by offering clear and concise assertion methods.
Table of Contents
Installation
PM> Install-Package DotNetToolbox.FluentAssertions
Dependencies
- DotNetToolbox.TestUtilities >= 8.0.3
- FluentAssertions >= 6.12.0
Features
- LoggerAssertions: Custom assertions for testing logging behavior.
- LoggerExtensions: Extension methods for FluentAssertions to work seamlessly with
ILogger
instances.
Usage
The library can be used in unit tests to assert various states and behaviors of loggers in .NET applications. Here are some examples:
logger.Should().BeEmpty();
logger.Should().HaveExactly(2);
logger.Contain(LogLevel.Information);
logger.Contain("Test 1.");
logger.ContainExactly(2, LogLevel.Error, "Error message.");
Configuration
No additional configuration is required beyond the standard setup for FluentAssertions.
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. |
-
net8.0
- DotNetToolbox.TestUtilities (>= 8.0.3)
- FluentAssertions (>= 6.12.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
v8.0.3:
Stable release of the DotNetToolbox.FluentAssertions library, an extension of FluentAssertions, tailored for .NET 8, aimed at providing specialized assertion capabilities for logging components in .NET applications. It enhances test readability and maintainability by offering clear and concise assertion methods.
Key Features:
- LoggerAssertions: Custom assertions for testing logging behavior.
- LoggerExtensions: Extension methods for FluentAssertions to work seamlessly with 'ILogger' instances.