public void AddTest(TestInformation info) { TreeNode node = GetNode(info.Name); node.ToolTipText = info.Tooltip; node.Tag = info; SetStyleBasedOnResult(node, info.Result); AddTestResultToStatistics(info.Result); }
private void ProcessTestResult(string message) { Match match = testResultPattern.Match(message); TestInformation info = new TestInformation { Name = match.Groups[1].Value, Result = TestResultFromString(match.Groups[2].Value) }; if (info.Result == TestResult.Passed) ui.AddTest(info); }
private void ProcessFileError(string message) { Match match = testErrorFilePattern.Match(message); TestInformation info = new TestInformation { Name = match.Groups[1].Value, FunctionName = match.Groups[2].Value, Path = match.Groups[3].Value, Line = int.Parse(match.Groups[4].Value) }; if (ui.IsTesting(info.FunctionName)) ui.SetTestPathAndLine(info); }
public void SetTestPathAndLine(TestInformation testInfo) { testInfo.Name = testInfo.Name.Replace('/', '.'); TreeNode testNode = GetNode(testInfo.Name); TestInformation info = (TestInformation)testNode.Tag; info.FunctionName = testInfo.FunctionName; info.Path = testInfo.Path; info.Line = testInfo.Line; testNode.Tag = info; TreeNode errorNode = testNode.Nodes.Add(info.Tooltip); SetStyleBasedOnResult(errorNode, info.Result); }
private void ProcessTestError(string message) { Match match = testErrorPattern.Match(message); string name = match.Groups[1].Value; string error = match.Groups[2].Value; TestResult result = TestResult.Failed; if (Regex.IsMatch(error, "Error:")) result = TestResult.Error; TestInformation info = new TestInformation { Name = name, Tooltip = error, Result = result }; ui.AddTest(info); }
private void OnTestMouseClick(object sender, TreeNodeMouseClickEventArgs clickEvent) { TreeNode clickedNode = clickEvent.Node; TestInformation info; try { info = (TestInformation)clickedNode.Tag; } catch (InvalidCastException) { info = new TestInformation(); } catch (NullReferenceException) { info = new TestInformation(); } SelectTextOnFileLine(info.Path, info.FunctionName); }
private void OnTestMouseClick(object sender, TreeNodeMouseClickEventArgs clickEvent) { TreeNode clickedNode = clickEvent.Node; TestInformation info; try { info = (TestInformation) clickedNode.Tag; } catch (InvalidCastException) { info = new TestInformation(); } catch (NullReferenceException) { info = new TestInformation(); } SelectTextOnFileLine(info.Path, info.FunctionName); }
public void SetTestPathAndLine(TestInformation testInfo) { testInfo.Name = testInfo.Name.Replace('/', '.'); TreeNode testNode = GetNode(testInfo.Name); TestInformation info = (TestInformation) testNode.Tag; info.FunctionName = testInfo.FunctionName; info.Path = testInfo.Path; info.Line = testInfo.Line; testNode.Tag = info; TreeNode errorNode = testNode.Nodes.Add(info.Tooltip); SetStyleBasedOnResult(errorNode, info.Result); }