0

I have a xUnit test to quickly check if my API behaves correctly. It's not mocked, just follows some scenarios on flows.

[Fact]
public async Task HappyPath()
{
    User = await authHelper.CreateUser();
    ContentCreator = await authHelper.CreateUser(isContentCreator: true);

    RequestId = await Create();

    await User_Should_See_Request_Before_Approval();
    await Content_Creator_Should_Not_See_Request_Before_Approval();

    await Approve();
    await Second_Approve_Should_Fail();

    await List();
    await Offer();
    await Offer();
    await Offer();

    //await Pay();

    // Cleanup
    if (shouldCleanup)
    {
        await Cleanup();
    }
}

All these methods are doing API calls with proper generated values.

When I debug the test, it runs normally and I can get the green tick. However, when I run the test (CTRL + R, T), even as a single, it keeps running indefinitely. While it runs I can observe all endpoints are called, and resources cleaned up. But the test just keeps running.

I'm not observing anything in the output (was hunting for exceptions) and on Visual Studio 2022 17.4.4.

Mithgroth
  • 1,114
  • 2
  • 13
  • 23
  • Try to run test from command line `dotnet test ` to check if this is test explorer issue. Or restart Visual Studio :) – Fabio Jan 18 '23 at 08:06

0 Answers0