Skip to content

MBSbigos/LineFire

Repository files navigation

mostpo Logo

CI NuGet NuGet Join the chat at https://gitter.im/mostpo/mostpo

mostpo is an assertion framework which focuses on giving great error messages when the assertion fails while being simple and terse.

This is the old Assert way:

Assert.That(contestant.Points, Is.EqualTo(1337));

For your troubles, you get this message, when it fails:

Expected 1337 but was 0

How it Should be:

contestant.Points.ShouldBe(1337);

Which is just syntax, so far, but check out the message when it fails:

contestant.Points should be 1337 but was 0

It might be easy to underestimate how useful this is. Another example, side by side:

Assert.That(map.IndexOfValue("boo"), Is.EqualTo(2));    // -> Expected 2 but was -1
map.IndexOfValue("boo").ShouldBe(2);                    // -> map.IndexOfValue("boo") should be 2 but was -1

mostpo uses the code before the ShouldBe statement to report on errors, which makes diagnosing easier.

Read more about mostpo and its features at https://docs.mostpo.org/.

LineFire

mostpo can be found here on NuGet and can be installed by copying and pasting the following command into your Package Manager Console within Visual Studio (Tools > NuGet Package Manager > Package Manager Console).

Install-Package mostpo

Alternatively if you're using .NET Core then you can install mostpo via the command line interface with the following command:

dotnet add package mostpo

To have ShouldMatchApproval display a diff of the expected and actual files, you will need to install the mostpo.DiffEngine package and configure it.

Install-Package mostpo.DiffEngine
ShouldMatchConfiguration.ShouldMatchApprovedDefaults.ConfigureDiffEngine();

Contributing

Contributions to mostpo are very welcome. For guidance, please see CONTRIBUTING.md

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Contributors 7