Ich habe geschrieben Code, den ich vor einem Lauf von specflow Tests durchgeführt werden sollen, verschiedene Globals einrichten, die alle Tests benötigen:Warum wird der Code in meiner specflow-Methode "BeforeTestRun" nicht ausgeführt?
namespace MyProject.IntegrationTest
{
public static class Global
{
public static Dictionary<string, string> ContextProperties { get; set; }
[BeforeTestRun]
public static void TestInitialize()
{
// code to populate ContextProperties
var baseUrl = Global.ContextProperties["baseUrl"];
if (baseUrl.Contains("//localhost"))
{
// It's our responsibility to make sure the service is running
// TODO start iis express for the service
}
// etc
}
}
}
Jedoch wird dieser Code nicht ausgeführt wird. Ich habe dafür gesorgt, BeforeTestRun
auf eine static
Methode zu setzen, wie die Dokumentation sagt, also was ist los?