public PopupItemViewModel(int symbolId, TestVm file, NSpan span, bool isDefenition, IntelliSensePopupViewModel popup) { SymbolId = symbolId; File = file; Span = span; IsDefenition = isDefenition; Text = file.Name + " (" + span + ")"; // TODO: convert to line pos and make line preview Popup = popup; }
public void SelectText(TestVm file, NSpan span) { if (Host.CurrentSolution == null) { return; } if (file == null) { return; } file.IsSelected = true; Selection = span; ScrollPosition = new ScrollPosition(CaretLine, CaretColumn); }
private void ShowDiff(TestVm test) { _para.Inlines.Clear(); if (test.PrettyPrintResult == null) { _para.Inlines.AddRange(new Inline[] { new Run("The test was never started.") { Foreground = Brushes.Gray } }); return; } if (test.TestState == TestState.Failure) { var lines = Diff(Split(test.Gold), Split(test.PrettyPrintResult)); lines.RemoveAt(0); lines.RemoveAt(lines.Count - 1); foreach (var line in lines) _para.Inlines.AddRange(line); } else if (test.TestState == TestState.Success) _para.Inlines.AddRange(new Inline[] { new Run("Output of the test and the 'gold' are identical.") { Foreground = Brushes.LightGreen } }); }
private void RunTest(TestVm test, RecoveryStrategy recoveryStrategy) { test.Run(recoveryStrategy); ShowDiff(test); }