Using .net core 3.1, I added an xunit project to a solution with the following test class:
using System.Collections.Generic;
using Xunit;
namespace BP
{
public class BreakPointFails
{
public static IEnumerable<object[]> GetData
{
get
{ // <------- VS never hits this breakpoint
return new List<object[]>
{
new object[] { "name", "Bill" },
new object[] { "name", "Paul" },
new object[] { "name", "Steve" }
};
}
}
[Theory]
[MemberData("GetData")]
public void ExtractScopeStringTest(string name, string lastName)
{
Assert.True(name != lastName);
}
}
}
If I mark a breakpoint at line with the comment "<------- VS never hits this breakpoint", VS debugger never stops at that line. Breakpoints anywhere else worke fine, but the in the methods pointed by [MemberData] attribute.
I am emphesising that the debug seup is fine and breakpoints anywhere in the test methods work perfect except methods pointed by [MemberData].
Why is that?
Update 1: Line with the breakpoint comment in the code above is juts to indicate a VS breakpoint to be added. The Markdown doesn't allow me to show a breakpoint red dot in the question.