Search code examples
integration-testingmspecfakeiteasy

Why does this simple MSpec test return inconclusive?


I am using Mspec with FakeItEasy and I keep getting inconclusive test results. I tried commenting out my fake setup code and even the actual invocation of the method under test. I'm also unable to debug the test. I also just tried a simple test like this:

private Then it_should_be_true = () => true.ShouldBeTrue();

What is the cause of inconclusive tests?

enter image description here

[Tags("IntegrationTest")]
[Subject(typeof(AuthManager))]
public class When_a_login_is_performed_using_valid_credentials
{
    protected static string MemberUsername;
    protected static string MemberPassword;
    protected static SignInResponse Response;

    private Given context = () =>
    {
        MemberUsername = "User1";
        MemberPassword = "Pass1";
    };

    private When test = () =>
    {
        Response = AuthManager.Current.SignIn(MemberUsername, MemberPassword);
    };

    private Then It_should_return_a_successful_response = () => Response.Success.ShouldBeTrue();
    private Then It_should_not_contain_any_reported_errors = () => Response.Errors.ShouldBeEmpty();
    private Then It_should_have_an_Id_populated = () => Response.Id.ShouldNotBeEmpty();
}

I wrapped It to become Then to match BDD syntax using the below code. It has always worked in the past.

using Machine.Specifications;

namespace Testing.MachineSpecifications
{
    /// <summary>
    /// Given
    /// </summary>
    [SetupDelegate]
    public delegate void Given();

    /// <summary>
    /// When
    /// </summary>
    [ActDelegate]
    public delegate void When();

    /// <summary>
    /// Then
    /// </summary>
    [AssertDelegate]
    public delegate void Then();
}

Solution

  • The machine.specifications.runner.resharper runner was one version behind ReSharper. In the future, it would be good to wait on upgrading ReSharper until the runner has time to catch up with compatibility.