DotNetToolbox.FluentAssertions
8.1.1
dotnet add package DotNetToolbox.FluentAssertions --version 8.1.1
NuGet\Install-Package DotNetToolbox.FluentAssertions -Version 8.1.1
<PackageReference Include="DotNetToolbox.FluentAssertions" Version="8.1.1" />
paket add DotNetToolbox.FluentAssertions --version 8.1.1
#r "nuget: DotNetToolbox.FluentAssertions, 8.1.1"
// Install DotNetToolbox.FluentAssertions as a Cake Addin #addin nuget:?package=DotNetToolbox.FluentAssertions&version=8.1.1 // Install DotNetToolbox.FluentAssertions as a Cake Tool #tool nuget:?package=DotNetToolbox.FluentAssertions&version=8.1.1
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.4
- FluentAssertions >= 6.12.0
Features
- Logger Assertions: Custom assertions for testing logging behavior.
- Logger Extensions: 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.1.1)
- 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.
DotNetToolbox.FluentAssertions Version 8.1.1
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.