TUnit icon indicating copy to clipboard operation
TUnit copied to clipboard

Test controls missing from gutter in Visual Studio

Open JohnCampionJr opened this issue 4 months ago • 6 comments

Image

This is not showing up in Visual Studio, just using the dotnet new Tunit template. The tests run fine and show in Test Explorer; just missing the gutter controls.

Seems similar to #3334 but the tests do show up in Test Explorer.

Using 0.67.19, tried both latest versions of 2022 and 2026 Insiders

JohnCampionJr avatar Oct 13 '25 03:10 JohnCampionJr

This will need raising with VS

thomhurst avatar Oct 13 '25 09:10 thomhurst

Is this the same issue I ran into here? https://resharper-support.jetbrains.com/hc/en-us/requests/8166002?page=1

In my case it's when using a parameterized constructor together with a DataSourceGenerator.

Image

Removing the generator and ctor bring the icons back:

Image

I noticed later though that both VS and Resharper icons were missing. Not sure if it's an IDE(s) or TUnit problem, if I run all tests in the solution the parameterized ones are found too and run and then also appear in both VS and Reshaper test explorers.

hugener avatar Oct 28 '25 10:10 hugener

With this meaningless minimal code I could reproduce it.

public enum Parameters
{
    One,
    Two,
    Three,
}

[ParameterDataSource]
public class T
{
    [TestConstructor]
    public T(Parameters parameters)
    {
    }

    [Test]
    public Task T2()
    {
        return Task.CompletedTask;
    }
}

public class ParameterDataSourceAttribute : DataSourceGeneratorAttribute<Parameters>
{
    private readonly Parameters[] _validParameters = [Parameters.One, Parameters.Two, Parameters.Three];

    protected override IEnumerable<Func<Parameters>> GenerateDataSources(DataGeneratorMetadata dataGeneratorMetadata)
    {
        foreach (var parameter in Enum.GetValues(typeof(Parameters)).Cast<Parameters>())
        {
            if (!_validParameters.Contains(parameter))
            {
                continue;
            }

            yield return () => parameter;
        }
    }
}

hugener avatar Oct 28 '25 10:10 hugener

Yeah it's still an ide issue. They don't like data driven class constructors. I think because this is quite a unique thing to TUnit and so it was never coded to support that since the other test frameworks didn't work like that.

thomhurst avatar Oct 28 '25 10:10 thomhurst

JetBrains confirm in the bug report it will be fixed for ReSharper 2025.3, which is slated for mid November release.

hugener avatar Oct 31 '25 14:10 hugener

Can you try the latest version out of rider

thomhurst avatar Nov 12 '25 08:11 thomhurst