Visual Studio Code unit test marked with question mark, no matter what the result is

Viewed 563

In Visual Studio Code, I have a specific unit test that no matter what the result is - is marked with a question mark.

I added other tests and they behave as expected (marked with either a green tick or red x).

What does the question mark mean ? enter image description here

[Fact]
public async Task LinuxHelper_ExecuteInvalidCommandBash_ShouldFail()
{
    //arrange
    
    //act
    //var bashExecutionResult = LinuxHelper.RunAsBash(@"dasda");
    
    //assert
    10.Should().Be(11);
    //bashExecutionResult.Succeeded.Should().BeFalse();
    //bashExecutionResult.Error.Should().NotBeNullOrEmpty();
    //bashExecutionResult.ExitCode.Should().NotBe(0);
}

Using C#, .NET Core Test Explorer VSC extension, with xUnit and FluentAssertions.

1 Answers

For me this occurred when I hadn't set a glob pattern for the Dotnet-test-explorer.testProjectPath setting, and had multiple test projects in my solution. Once I set that option to **/*.Test.csproj it could manage the results from running all of the tests.

Related