Using Xunit, how can I get the name of the currently running test?
public class TestWithCommonSetupAndTearDown : IDisposable
{
public TestWithCommonSetup
I can't speak to xUnit ... but this did work for me in VS Testing. might be worth a shot.
Reference: How to get the name of the current method from code
Example:
[TestMethod]
public void TestGetMethod()
{
StackTrace st = new StackTrace();
StackFrame sf = st.GetFrame(0);
MethodBase currentMethodName = sf.GetMethod();
Assert.IsTrue(currentMethodName.ToString().Contains("TestGetMethod"));
}