Repository: dotnet/runtime
File: src/tests/Common/XUnitWrapperGenerator/ITestInfo.cs (C#)

Code before:
        hash = hash * 23 + (Method?.GetHashCode() ?? 0);
        hash = hash * 23 + (ContainingType?.GetHashCode() ?? 0);
        return hash;
    }
}

public sealed class ConditionalTest : ITestInfo
{
    public ConditionalTest(ITestInfo innerTest, string condition)
    {
        TestNameExpression = innerTest.TestNameExpression;
        DisplayNameForFiltering = innerTest.DisplayNameForFiltering;
        Method = innerTest.Method;
        ContainingType = innerTest.ContainingType;

        _innerTest = innerTest;
        _condition = condition;
    }

    public ConditionalTest(ITestInfo innerTest, Xunit.TestPlatforms platform)
        : this(innerTest, GetPlatformConditionFromTestPlatform(platform))
    {
    }
    
    public ConditionalTest(ITestInfo innerTest, string condition, Xunit.TestPlatforms platform)
        :this(innerTest, $"{(condition.Length == 0 ? "true" : condition)} && ({GetPlatformConditionFromTestPlatform(platform)})")
    {
    }

    public string TestNameExpression { get; }
    public string DisplayNameForFiltering { get; }
    public string Method { get; }
    public string ContainingType { get; }

    private ITestInfo _innerTest;
    private string _condition;

    public CodeBuilder GenerateTestExecution(ITestReporterWrapper testReporterWrapper)
    {
        CodeBuilder builder = new();
        builder.AppendLine($"if ({_condition})");

        using (builder.NewBracesScope())
        {
            builder.Append(_innerTest.GenerateTestExecution(testReporterWrapper));
        }

        builder.AppendLine($"else");

        using (builder.NewBracesScope())
        {

Review comment (suggestion):
There’s trailing whitespace on the blank line before this constructor, and the constructor initializer is missing a space after `:` (`:this` vs `: this`). Please align with the surrounding formatting to avoid style/formatting churn.
```suggestion

    public ConditionalTest(ITestInfo innerTest, string condition, Xunit.TestPlatforms platform)
        : this(innerTest, $"{(condition.Length == 0 ? "true" : condition)} && ({GetPlatformConditionFromTestPlatform(platform)})")
```

Code after:
        hash = hash * 23 + (Method?.GetHashCode() ?? 0);
        hash = hash * 23 + (ContainingType?.GetHashCode() ?? 0);
        return hash;
    }
}

public sealed class ConditionalTest : ITestInfo
{
    public ConditionalTest(ITestInfo innerTest, string condition)
    {
        TestNameExpression = innerTest.TestNameExpression;
        DisplayNameForFiltering = innerTest.DisplayNameForFiltering;
        Method = innerTest.Method;
        ContainingType = innerTest.ContainingType;

        _innerTest = innerTest;
        _condition = condition;
    }

    public ConditionalTest(ITestInfo innerTest, Xunit.TestPlatforms platform)
        : this(innerTest, GetPlatformConditionFromTestPlatform(platform))
    {
    }

    public ConditionalTest(ITestInfo innerTest, string condition, Xunit.TestPlatforms platform)
        : this(innerTest, $"{(condition.Length == 0 ? "true" : condition)} && ({GetPlatformConditionFromTestPlatform(platform)})")
    {
    }

    public string TestNameExpression { get; }
    public string DisplayNameForFiltering { get; }
    public string Method { get; }
    public string ContainingType { get; }

    private ITestInfo _innerTest;
    private string _condition;

    public CodeBuilder GenerateTestExecution(ITestReporterWrapper testReporterWrapper)
    {
        CodeBuilder builder = new();
        builder.AppendLine($"if ({_condition})");

        using (builder.NewBracesScope())
        {
            builder.Append(_innerTest.GenerateTestExecution(testReporterWrapper));
        }

        builder.AppendLine($"else");

        using (builder.NewBracesScope())
        {