Skip to content
This repository has been archived by the owner on Jun 12, 2021. It is now read-only.

Can I use xbehave.net with fluent assertion libraries?

Adam Ralph edited this page Aug 4, 2015 · 2 revisions

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));
    }
}
Clone this wiki locally