HotRS.MockLoggingExtensions
1.0.3.3
dotnet add package HotRS.MockLoggingExtensions --version 1.0.3.3
NuGet\Install-Package HotRS.MockLoggingExtensions -Version 1.0.3.3
<PackageReference Include="HotRS.MockLoggingExtensions" Version="1.0.3.3" />
paket add HotRS.MockLoggingExtensions --version 1.0.3.3
#r "nuget: HotRS.MockLoggingExtensions, 1.0.3.3"
// Install HotRS.MockLoggingExtensions as a Cake Addin #addin nuget:?package=HotRS.MockLoggingExtensions&version=1.0.3.3 // Install HotRS.MockLoggingExtensions as a Cake Tool #tool nuget:?package=HotRS.MockLoggingExtensions&version=1.0.3.3
HotRS.MockLoggingExtensions
This nuget provides an extension to a MOQ Logger<T> object, which simplifies the verification that a specified string was logged.
Example:
mockLogger.VerifyLogContent("expectedstring", Times.Once, MockLoggerExtensions.ComparisonType.StartsWith);
mockLogger.VerifyLogContent($"Order number { request.OrderNumber}: Invalid request recieved with errors", Times.Once, MockLoggerExtensions.ComparisonType.StartsWith, StringComparison.OrdinalIgnoreCase);
Note: You must change the creation of the logger to:
Create<ILogger<classname>>(MockBehavior.Loose)
Follow/Contribute to the project:
https://github.com/rkreisel/HotRS.MockLoggingExtensions
Version History
20220309 -1.0.1 - Added optional StringComparison to methods 20220309 -1.0.2 - Added ReadMe only (no code change) 20220312 - 1.0.2.2 - version # change for testing code coverage changes 20220312 - 1.0.3.x - Fixing version # problems and added readme
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
-
net6.0
- Microsoft.Extensions.Logging.Abstractions (>= 6.0.1)
- Moq (>= 4.17.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
20220309 -1.0.1 - Added optional StringComparison to methods