nspec/NSpec

Website: replace deleted assertion extensions

BrainCrumbz opened this issue · 6 comments

@amirrajan , at some point during the port to .NET Core, we decided to drop almost all assertion extensions from NSpec library, only a few remained: IsTrue, IsFalse, ShouldBeTrue, ShouldBeFalse.

This means that many code examples in website should be modified because of this 😰

PS for those remaning assertions: naming was changed to classical .NET style. If there's pressure, we can rename them with previous style (foo_bar_baz).

Oh geez, is Fluent Assertions core compatible?

It says so:

It runs on .NET 4.0, 4.5, 4.6, CoreClr, .NET Native, Windows 8.1, Silverlight 5, Windows Phone 8.0…

When we started porting, at that time it wasn't and so sample used to show how to configure solution in .NET Core uses Shouldy as well. At this level of usage, they look the same:

it["Should return same number"] = () => first.ShouldBe(second);

@amirrajan what's your take about it?

(A) Convert every assertion to the form (some predicate).ShouldBeTrue()?
(B) Convert assertions (where needed) to FluentAssertions form, and state that for those examples we're using it?
(C) Convert assertions (where needed) to FluentAssertions form, and state that for those examples we're using it?
(D) ... add yours!

I'd go for B, or C as second place.

@amirrajan now syntax highlighting seems to work, maybe not perfect but still...

How should we move on with this issue? Maybe it's a good time to copy contents from gists to page, and at the same time replace assertions with the one we choose.

BTW it seems there's a typo in bulleted list above (A ... D): points B and C are the same, and at this point it's not really clear what was the alternative to FluentAssertions form: Shouldy? previous snake_case style?

I'd say got with FluentAssertions and whatever casing convention they support.