Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using FluentAssertions;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you target net6.0 you can add this to global usings in your csproj (or Directory.Build.props).

<ItemGroup>
    <Using Include="CSharpFunctionalExtensions" />
</ItemGroup>

using CSharpFunctionalExtensions;
using FluentAssertions.Execution;
using FluentAssertions.Primitives;

namespace CSharpFunctionalExtensions.FluentAssertions;
namespace FluentAssertions;

public static class MaybeExtensions
{
Expand All @@ -14,7 +14,7 @@ public class MaybeAssertions<T> : ReferenceTypeAssertions<Maybe<T>, MaybeAsserti
public MaybeAssertions(Maybe<T> instance) : base(instance) { }

protected override string Identifier => "Maybe{T}";

/// <summary>
/// Asserts that the current <see cref="Maybe{T}"/> has some value.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using FluentAssertions;
using CSharpFunctionalExtensions;
using FluentAssertions.Execution;
using FluentAssertions.Primitives;

namespace CSharpFunctionalExtensions.FluentAssertions;
namespace FluentAssertions;

public static class ResultExtensions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using FluentAssertions.Execution;
using CSharpFunctionalExtensions;
using FluentAssertions.Execution;
using FluentAssertions.Primitives;
using FluentAssertions;

namespace CSharpFunctionalExtensions.FluentAssertions;
namespace FluentAssertions;
public static class ResultTEExtensions
{
public static ResultTEAssertions<T, E> Should<T, E>(this Result<T, E> instance) => new(instance);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using FluentAssertions;
using CSharpFunctionalExtensions;
using FluentAssertions.Execution;
using FluentAssertions.Primitives;

namespace CSharpFunctionalExtensions.FluentAssertions;
namespace FluentAssertions;

public static class ResultTExtensions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using FluentAssertions.Execution;
using CSharpFunctionalExtensions;
using FluentAssertions.Execution;
using FluentAssertions.Primitives;
using FluentAssertions;

namespace CSharpFunctionalExtensions.FluentAssertions;
namespace FluentAssertions;
public static class UnitResultExtensions
{
public static UnitResultAssertions<E> Should<E>(this UnitResult<E> instance) => new(instance);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void WhenMaybeIsExpectedToHaveValueAndItHasWrongValueShouldThrow()
{
var maybe = Maybe.From("oops");

Action act = () => maybe.Should().HaveValue("test", "it is test");
var act = () => maybe.Should().HaveValue("test", "it is test");

act.Should().Throw<Exception>().WithMessage($"*value \"test\" because it is test, but with value \"oops\" it*");
}
Expand All @@ -37,7 +37,7 @@ public void WhenMaybeIsExpectedToHaveValueAndItDoesNotShouldThrow()
{
Maybe<string> maybe = null;

Action act = () => maybe.Should().HaveValue("test", "it is not None");
var act = () => maybe.Should().HaveValue("test", "it is not None");

act.Should().Throw<Exception>().WithMessage($"*value \"test\" because it is not None*");
}
Expand All @@ -55,7 +55,7 @@ public void WhenMaybeIsExpectedToHaveNoValueAndItHasOneShouldThrow()
{
var maybe = Maybe.From("test");

Action act = () => maybe.Should().HaveNoValue("it is None");
var act = () => maybe.Should().HaveNoValue("it is None");

act.Should().Throw<Exception>().WithMessage($"*Maybe to have no value because it is None, but with value \"test\" it*");
}
Expand Down