Can I use xbehave.net with fluent assertion libraries? - adamralph/xbehave.net GitHub Wiki

Of course!

You can use any fluent assertion library you like with xBehave.net.

Our recommendation is FluentAssertions.

E.g.

using FluentAssertions;

public class CalculatorFeature
{
    [Scenario]
    public void Addition(int x, int y, Calculator calculator, int answer)
    {
        "Given the number 1"
            .x(() => x = 1);

        "And the number 2"
            .x(() => y = 2);

        "And a calculator"
            .x(() => calculator = new Calculator());

        "When I add the numbers together"
            .x(() => answer = calculator.Add(x, y));

        "Then the answer is 3"
            .x(() => answer.Should().Be(3));
    }
}