Description
Related to #5428.
If I have to test the same logic for different cultures and inherit the test class, hooks are still executed twice.
Expected Behavior
Overridden test hook is executed once
Actual Behavior
Overridden test hook is executed twice.
Steps to Reproduce
public class BaseTestClass
{
[Before(Test)]
public virtual async Task SetupAsync()
{
Console.WriteLine("Base setup");
}
}
public abstract class TestClass : BaseTestClass
{
[Before(Test)]
public override async Task SetupAsync()
{
await base.SetupAsync();
Console.WriteLine("Complemented setup");
}
}
[Culture("en-US")]
[InheritsTests]
public TestClass_enUS : TestClass {}
[Culture("de-DE")]
[InheritsTests]
public TestClass_deDE : TestClass {}
TUnit Version
1.29.0
.NET Version
.NET 10
Operating System
Windows
IDE / Test Runner
dotnet CLI (dotnet test / dotnet run)
Error Output / Stack Trace
Base setup
Complemented setup
Base setup
Complemented setup
Additional Context
A workaround is to remove the [Before(Test)] attribute on the abstract class.
IDE-Specific Issue?
Description
Related to #5428.
If I have to test the same logic for different cultures and inherit the test class, hooks are still executed twice.
Expected Behavior
Overridden test hook is executed once
Actual Behavior
Overridden test hook is executed twice.
Steps to Reproduce
TUnit Version
1.29.0
.NET Version
.NET 10
Operating System
Windows
IDE / Test Runner
dotnet CLI (dotnet test / dotnet run)
Error Output / Stack Trace
Additional Context
A workaround is to remove the
[Before(Test)]attribute on the abstract class.IDE-Specific Issue?
dotnet testordotnet run, not just in my IDE