vkhorikov/CSharpFunctionalExtensions

Extensions for FluentAssertion

Opened this issue · 3 comments

Every time I use this library I need write tests and verify Result or Maybe in these tests.

I'm using FluentAssertion and would like to write assertions in some kind:

result.Should().BeSuccessful()
                .And.Value.Should().Be(expected);

The same idea for BeFailed() extension. For MayBe I suggest extension methods like HaveValue() and HaveNoValue().

May be create additional package like CSharpFunctionalExtensions.FluentAssertions to do not copy/past same extension methods from project to project.

What do you think about it?

I can create PR, but first of all I would like to discuss the idea.

Thank you!

Actually there is an unofficial package that does exactly that.
https://www.nuget.org/packages/FluentAssertions.CSharpFunctionalExtensions/

Spoiler: I've never tried it :)

Many thanks!

My bad.

Package you suggested cover assertion around Result.

Huh, I didn't know about that package :) I'll link it in the readme. There's no extensions for Maybe there, though.