JNet.Util.ShouldlyFluentExtension
1.0.0
dotnet add package JNet.Util.ShouldlyFluentExtension --version 1.0.0
NuGet\Install-Package JNet.Util.ShouldlyFluentExtension -Version 1.0.0
<PackageReference Include="JNet.Util.ShouldlyFluentExtension" Version="1.0.0" />
paket add JNet.Util.ShouldlyFluentExtension --version 1.0.0
#r "nuget: JNet.Util.ShouldlyFluentExtension, 1.0.0"
// Install JNet.Util.ShouldlyFluentExtension as a Cake Addin #addin nuget:?package=JNet.Util.ShouldlyFluentExtension&version=1.0.0 // Install JNet.Util.ShouldlyFluentExtension as a Cake Tool #tool nuget:?package=JNet.Util.ShouldlyFluentExtension&version=1.0.0
ShouldlyFluentExtension
ShouldlyFluentExtension is a powerful and expressive fluent API designed to streamline writing unit tests with ease and readability. It provides a concise and natural language syntax for making assertions, eliminating the need for explicit variable declarations, and enhancing code maintainability.
Features
- Fluent API: Easily chain multiple assertions on the same object without the need to assign variables manually. This results in clean and concise test code that is more maintainable and less error-prone.
- Eliminate Repetition: By removing the need for repetitive variable declarations, your test code becomes more compact and focused, reducing the chances of copy-paste errors and code duplication.
- Readable Assertions: The expressive syntax of ShouldlyFluentExtension enables you to write self-explanatory assertions, making it easier for other team members to understand the intent of each test case.
- Integration with NUnit: Seamless integration with the NUnit testing framework, allowing you to leverage the full power of NUnit's test runners and reporting capabilities.
Example Usage
With ShouldlyFluentExtension, writing unit tests becomes more elegant and efficient. Say goodbye to boilerplate variable declarations and embrace the clarity and productivity provided by this lightweight, yet feature-rich library.
Find(1)
.ShouldBe(x => x.Id, 1)
.ShouldBe(x => x.Name, "Num");
Full example:
using ShouldlyFluentExtension;
Item Find(int i) => new Item(i, "Num");
Find(1)
.ShouldBe(x => x.Id, 1)
.ShouldBe(x => x.Name, "Num");
Console.WriteLine("Hello, World!");
record Item(int Id, string Name);
Getting Started
- Install the ShouldlyFluentExtension NuGet package in your test project.
- Use the provided fluent syntax to write expressive assertions in your unit tests.
- Enjoy more readable and maintainable test code that empowers your testing efforts.
Installation
Use NuGet Package Manager to install ShouldlyFluentExtension:
Install-Package JNet.Util.ShouldlyFluentExtension
Documentation and Contribution
For the latest updates, documentation, and contribution guidelines, visit our GitHub repository: ShouldlyFluentExtension
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
- Shouldly (>= 4.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 172 | 7/27/2023 |