I have some test projects using xunit and doing some assembly wide initialization code using xunit´s TestFrameworkAttribute.
So in the test library project I put this into the AssemblyInfo.cs file:
[assembly: Xunit.TestFramework("MyTestFrameworkClass", "MyTestFrameworkAssembly")]
A simple class doing what I want to demonstrate can look e.g. like this:
public class SampleTestFramework : XunitTestFramework
{
public static int Number { get; set; }
public SampleTestFramework(IMessageSink messageSink)
: base(messageSink)
{
Number = 5;
}
}
If I create a test in the assembly like this:
public void ATest()
{
Assert.Equal(5, SampleTestFramework.Number);
}
It fails in CodeRush´s test runner, while it works in basically every other test runner I could use (xunit´s console runner, visual studio test explorer, the test runners of Resharper and NCrunch).
So obviously CodeRush´s test runner disregards this attribute. Is there some option to turn it on or is it just a bug?
If you need a sample solution I can provide one, if you want.
Greetings
Gerald
Hi Gerald,
Thank you for reaching out to us.
I've successfully reproduced this behavior and passed this ticket to our developers. We'll notify you once we make any progress.