I have a BDDfy test set up as follows:
public MofiAnalysesPhrase() : base("Mofichan analyses a phrase given to her")
{
var command = default(string);
var tags = default(IEnumerable<string>);
this.Given(s => s.Given_Mofichan_is_configured_with_behaviour("analysis"))
.And(s => s.Given_Mofichan_is_running())
.When(s => s.When_Mofichan_receives_a_message(this.JohnSmithUser, command))
.And(s => s.When_behaviours_are_driven_by__pulseCount__pulses(2))
.Then(s => s.Then_Mofichan_should_have_responded_with_expected_analysis(tags))
.WithExamples(new ExampleTable("command", "tags")
{
{ "Mofi, perform analysis \"hello Mofi\"", new[] { "directedAtMofichan", "greeting" } },
{ "Mofi, perform analysis: \"how are you doing?\"", new[] { "wellbeing" } },
{ "Mofi, analyse: \"you're the best!\"", new[] { "positive" } },
{ "Mofi, analyse phrase: \"you're the worst!\"", new[] { "negative" } },
{ "Mofi, analyse phrase: \"That's right Mofi\"", new[] { "directedAtMofichan", "affirmation" } },
{ "Mofi, analyse phrase: \"That's correct Mofi\"", new[] { "directedAtMofichan", "affirmation" } },
{ "Mofi, analyse phrase: \"That's wrong Mofi\"", new[] { "directedAtMofichan", "refutation" } },
{ "Mofi, analyse phrase: \"That's incorrect Mofichan\"", new[] { "directedAtMofichan", "refutation" } },
})
.TearDownWith(s => s.TearDown());
}
This BDDfy test is configured to run for a set of example data. Currently, some of these examples pass and some fail.
Up until the first failure, the tests work as expected - the given, when and then steps are performed in order, followed by the teardown using TearDown(). However, as soon as the first test failure occurs (signified by an exception being raised within Then_Mofichan_should_have_responded_with_expected_analysis), the teardown method stops being invoked, meaning that all following tests fail due to the test context not being "clean" as opposed to the actual code under test being wrong. By stepping through the code using a debugger, I can see that as soon as an exception is thrown within the Then step, the test runner invokes the Given_Mofichan_is_configured_with_behaviour without going through TearDown first.
I get the following output when running these tests:

I have a BDDfy test set up as follows:
This BDDfy test is configured to run for a set of example data. Currently, some of these examples pass and some fail.
Up until the first failure, the tests work as expected - the
given,whenandthensteps are performed in order, followed by the teardown usingTearDown(). However, as soon as the first test failure occurs (signified by an exception being raised withinThen_Mofichan_should_have_responded_with_expected_analysis), the teardown method stops being invoked, meaning that all following tests fail due to the test context not being "clean" as opposed to the actual code under test being wrong. By stepping through the code using a debugger, I can see that as soon as an exception is thrown within theThenstep, the test runner invokes theGiven_Mofichan_is_configured_with_behaviourwithout going throughTearDownfirst.I get the following output when running these tests: