Last active
June 21, 2018 05:54
-
-
Save dupdob/e53c1e6e0291688088687c921bee751c to your computer and use it in GitHub Desktop.
Extending NFluent to support FluentAssertions/Shouldly like syntax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace ExtraFluent | |
{ | |
public static class ExtraFluent | |
{ | |
/// <summary> | |
/// Provides entry point to NFluent checks using extension syntax | |
/// </summary> | |
/// <param name="sut">the system under test</param> | |
/// <typeparam name="T">Type of the system under test.</typeparam> | |
/// <returns>an Instance of <see cref="ICheck{T}"/></returns> | |
// voir GH #253 | |
public static ICheck<T> Verifies<T>(this T sut) | |
{ | |
return Check.That(sut); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you prefer FluentAssertions/Shouldly like syntax for your assertion instead of the the glorious Check.That entry point, just add this class to your tests.
You can then write your assertions like this