public void RunTests(IEnumerable <string> sources, IRunContext runContext, IFrameworkHandle frameworkHandle) { //if (Debugger.IsAttached) Debugger.Break(); //else Debugger.Launch(); try { var parsed = XElement.Parse(runContext.RunSettings.SettingsXml); runContext.RunSettings.GetSettings(AppConfig.Name).Load(parsed.Element(AppConfig.Name).CreateReader()); } catch (Exception ex) { Console.WriteLine($"Framework: Error while loading SettingsXml - {ex.Message} {ex.Data}"); } try { frameworkHandle.SendMessage(TestMessageLevel.Informational, "Framework: Running from process:" + Process.GetCurrentProcess() + " ID:" + Process.GetCurrentProcess().Id.ToString()); foreach (var source in sources) { frameworkHandle.SendMessage(TestMessageLevel.Informational, "Framework: Finding tests in source:" + source); } IEnumerable <TestCase> tests = ProtractorTestDiscoverer.GetTests(sources, null); foreach (var test in tests) { frameworkHandle.SendMessage(TestMessageLevel.Informational, "Framework: Found test:" + test.DisplayName); } RunTests(tests, runContext, frameworkHandle); } catch (Exception e) { frameworkHandle.SendMessage(TestMessageLevel.Error, "Framework: Exception during test execution: " + e.Message); } }
public void RunTests(IEnumerable <string> sources, IRunContext runContext, IFrameworkHandle frameworkHandle) { try { frameworkHandle.SendMessage(TestMessageLevel.Informational, "Running from process:" + Process.GetCurrentProcess() + " ID:" + Process.GetCurrentProcess().Id.ToString()); foreach (var source in sources) { frameworkHandle.SendMessage(TestMessageLevel.Informational, "Finding tests in source:" + source); } IEnumerable <TestCase> tests = ProtractorTestDiscoverer.GetTests(sources, null); foreach (var test in tests) { frameworkHandle.SendMessage(TestMessageLevel.Informational, "Found test:" + test.DisplayName); } RunTests(tests, runContext, frameworkHandle); } catch (Exception e) { frameworkHandle.SendMessage(TestMessageLevel.Error, "Exception during test execution: " + e.Message); } }