Setting the test name in the property in the class (#147)

Using CallerMemberName attribute to get the test name for generating the test result instead of having a name passed as a parameter for each test method
This commit is contained in:
Leila Lali
2016-11-16 11:39:48 -08:00
committed by GitHub
parent 32f6cbc304
commit c2ffd4c2a5
4 changed files with 46 additions and 48 deletions

View File

@@ -6,6 +6,7 @@
using System;
using System.Globalization;
using System.IO;
using System.Runtime.CompilerServices;
namespace Microsoft.SqlTools.ServiceLayer.TestDriver.Utility
{
@@ -43,7 +44,7 @@ namespace Microsoft.SqlTools.ServiceLayer.TestDriver.Utility
EndDateTime = DateTime.UtcNow;
}
public void EndAndPrint(string testName)
public void EndAndPrint([CallerMemberName] string testName = "")
{
End();
var currentColor = Console.ForegroundColor;