I am trying to output a method name to a file title Currently my code is
public async Task TestMethod()
{
string fileName = testDirectory + "TC521_" + MethodBase.GetCurrentMethod().Name + "_" + DateTime.Now.ToString("dd-MM-yyyy-hh-mm-ss") + ".txt";
}
But the filename comes back as
Response_TC521_MoveNext_27-10-2020-11-52-17.txt
I would like it to come back as
Response_TC521_TestMethod_27-10-2020-11-52-17.txt
Any ideas?