示例#1
0
 private void OpenSolution(string solutionFilePath)
 {
     _settings.CurrentSolution = solutionFilePath;
     _solution = new SolutionVm(solutionFilePath, null, _settings.Config);
     _testsTreeView.ItemsSource = _solution.TestSuits;
     RecentFileList.InsertFile(solutionFilePath);
 }
        public IActionResult Index()
        {
            var serviceClient   = new ServiceHealthClientService();
            var servicesHeatlth = serviceClient.GetDataAsync();

            var solution = new SolutionVm
            {
                Name = "D3A Services",
                Data = servicesHeatlth.Result
            };

            return(View(solution));
        }
示例#3
0
        private void LoadTests()
        {
            var selected     = _testsTreeView.SelectedItem as FullPathVm;
            var selectedPath = selected == null ? null : selected.FullPath;

            if (!File.Exists(_settings.CurrentSolution ?? ""))
            {
                MessageBox.Show(this, "Solution '" + _settings.CurrentSolution + "' not exists!");
                return;
            }

            _solution  = new SolutionVm(_settings.CurrentSolution, selectedPath, _settings.Config);
            this.Title = _solution.Name + " - " + Constants.AppName;
            _testsTreeView.ItemsSource = _solution.TestSuits;
        }
示例#4
0
        static void Start(string solutinFilePath, string config)
        {
            var solution  = new SolutionVm(solutinFilePath, null, config);
            var testSuits = solution.TestSuits;

            var maxNameLen                = CalcMaxNameLen(testSuits);
            var someTestsFailed           = false;
            var someTestSuitsFailedToLoad = false;

            foreach (var suit in testSuits)
            {
                PrintLine("Test suit: " + suit.Name);
                Indent();

                if (suit.TestState == TestState.Ignored)
                {
                    PrintLine(suit.Hint, ConsoleColor.Red);
                    someTestSuitsFailedToLoad = true;
                    Unindent();
                    continue;
                }

                foreach (var test in suit.Tests)
                {
                    var dots = maxNameLen - test.Name.Length;
                    Print(test.Name + " " + new string('.', dots) + " ");
                    Console.Out.Flush();
                    test.Run();

                    switch (test.TestState)
                    {
                    case TestState.Skipped:
                        ContinuePrint("skipped.", ConsoleColor.Yellow);
                        break;

                    case TestState.Failure:
                        ContinuePrint("failed!", ConsoleColor.Red);
                        someTestsFailed = true;
                        Indent();
                        Diff(test);
                        Unindent();

                        break;

                    case TestState.Ignored:
                        ContinuePrint("ignored.", ConsoleColor.Yellow);
                        break;

                    case TestState.Inconclusive:
                        ContinuePrint("inconclusive.", ConsoleColor.Yellow);
                        break;

                    case TestState.Success:
                        ContinuePrint("passed.", ConsoleColor.Green);
                        break;

                    default:
                        break;
                    }
                }

                Unindent();
            }

            if (someTestSuitsFailedToLoad)
            {
                PrintLine("Some test suits is failed to load!", ConsoleColor.Red);
            }
            if (someTestsFailed)
            {
                PrintLine("Some tests is failed!", ConsoleColor.Red);
            }

            Console.WriteLine("done...");

            if (someTestsFailed || someTestSuitsFailedToLoad)
            {
                //Console.ReadLine();
                Environment.Exit(-1);
            }
        }
示例#5
0
        static void Start(string solutinFilePath, string config)
        {
            var solution   = new SolutionVm(solutinFilePath, null, config);
            var testSuites = solution.TestSuites;

            var maxNameLen                 = CalcMaxNameLen(testSuites);
            var someTestsFailed            = false;
            var someTestSuitesFailedToLoad = false;

            foreach (var suite in testSuites)
            {
                PrintLine("Test suite: " + suite.Name);
                Indent();

                if (suite.TestState == TestState.Ignored)
                {
                    PrintLine(suite.Hint, ConsoleColor.Red);
                    someTestSuitesFailedToLoad = true;
                    Unindent();
                    continue;
                }

                foreach (var test in suite.Tests)
                {
                    var dots = maxNameLen - test.Name.Length;
                    Print(test.Name + " " + new string('.', dots) + " ");
                    Console.Out.Flush();
                    {
                        var testFile = test as TestVm;
                        if (testFile != null)
                        {
                            someTestsFailed |= RunTestFile(testFile);
                        }
                    }
                    {
                        var testFolder = test as TestFolderVm;
                        if (testFolder != null)
                        {
                            foreach (var testFile in testFolder.Tests)
                            {
                                someTestsFailed |= RunTestFile(testFile);
                            }
                        }
                    }
                }

                Unindent();
            }

            if (someTestSuitesFailedToLoad)
            {
                PrintLine("Some test suits is failed to load!", ConsoleColor.Red);
            }
            if (someTestsFailed)
            {
                PrintLine("Some tests is failed!", ConsoleColor.Red);
            }

            Console.WriteLine("done...");

            if (someTestsFailed || someTestSuitesFailedToLoad)
            {
                //Console.ReadLine();
                Environment.Exit(-1);
            }
        }
示例#6
0
        public MainWindow()
        {
            _settings = Settings.Default;

            ToolTipService.ShowDurationProperty.OverrideMetadata(
                typeof(DependencyObject),
                new FrameworkPropertyMetadata(Int32.MaxValue));

            InitializeComponent();

            this.Top         = _settings.WindowTop;
            this.Left        = _settings.WindowLeft;
            this.Height      = _settings.WindowHeight;
            this.Width       = _settings.WindowLWidth;
            this.WindowState = (WindowState)_settings.WindowState;
            _mainRow.Height  = new GridLength(_settings.TabControlHeight);


            _configComboBox.ItemsSource = new[] { "Debug", "Release" };
            var config = _settings.Config;

            _configComboBox.SelectedItem = config == "Release" ? "Release" : "Debug";

            _tabControl.SelectedIndex = _settings.ActiveTabIndex;
            _foldingStrategy          = new NitraFoldingStrategy();
            _textBox1Tooltip          = new ToolTip {
                PlacementTarget = _text
            };
            _parseTimer = new Timer {
                AutoReset = false, Enabled = false, Interval = 300
            };
            _parseTimer.Elapsed += _parseTimer_Elapsed;

            _text.TextArea.Caret.PositionChanged += Caret_PositionChanged;

            _highlightingStyles = new Dictionary <string, HighlightingColor>
            {
                { "Keyword", new HighlightingColor {
                      Foreground = new SimpleHighlightingBrush(Colors.Blue)
                  } },
                { "Comment", new HighlightingColor {
                      Foreground = new SimpleHighlightingBrush(Colors.Green)
                  } },
                { "Number", new HighlightingColor {
                      Foreground = new SimpleHighlightingBrush(Colors.Magenta)
                  } },
                { "Operator", new HighlightingColor {
                      Foreground = new SimpleHighlightingBrush(Colors.Navy)
                  } },
                { "String", new HighlightingColor {
                      Foreground = new SimpleHighlightingBrush(Colors.Maroon)
                  } },
            };

            _foldingManager    = FoldingManager.Install(_text.TextArea);
            _textMarkerService = new TextMarkerService(_text.Document);

            _text.TextArea.TextView.BackgroundRenderers.Add(_textMarkerService);
            _text.TextArea.TextView.LineTransformers.Add(_textMarkerService);
            _text.Options.ConvertTabsToSpaces        = true;
            _text.Options.EnableRectangularSelection = true;
            _text.Options.IndentationSize            = 2;
            _testsTreeView.SelectedValuePath         = "FullPath";

            if (string.IsNullOrWhiteSpace(_settings.CurrentSolution))
            {
                _solution = null;
            }
            else
            {
                LoadTests();
            }
        }