public TestVm(string testPath, TestSuitVm testSuit) : base(testPath) { TestPath = testPath; TestSuit = testSuit; if (TestSuit.TestState == TestState.Ignored) TestState = TestState.Ignored; }
public TestVm(string testPath, TestSuitVm testSuit) : base(testPath) { TestPath = testPath; TestSuit = testSuit; if (TestSuit.TestState == TestState.Ignored) { TestState = TestState.Ignored; } }
public SolutionVm(string solutinFilePath, string selectePath, string config) { var isSolutinFileExists = solutinFilePath != null && File.Exists(solutinFilePath); if (!isSolutinFileExists) { var message = "The '" + solutinFilePath + "' not exists."; Debug.Assert(isSolutinFileExists, message); // ReSharper disable once HeuristicUnreachableCode throw new ApplicationException(message); } SolutinFilePath = solutinFilePath; RootFolder = Path.GetDirectoryName(solutinFilePath); var suits = File.ReadAllLines(solutinFilePath); var rootDir = Path.GetDirectoryName(solutinFilePath); Debug.Assert(rootDir != null, "rootDir != null"); TestSuits = new ObservableCollection <TestSuitVm>(); foreach (var aSuit in suits) { var suit = aSuit.Trim(); if (string.IsNullOrEmpty(suit)) { continue; } var testSuit = new TestSuitVm(this, suit, config); if (selectePath != null) { if (testSuit.FullPath == selectePath) { testSuit.IsSelected = true; // Прикольно что по другому фокус не изменить! } else { foreach (var test in testSuit.Tests) { if (test.FullPath == selectePath) { test.IsSelected = true; } } } } } TestSuits.CollectionChanged += TestSuits_CollectionChanged; IsDirty = false; }
public SolutionVm(string solutinFilePath, string selectePath, string config) { var isSolutinFileExists = solutinFilePath != null && File.Exists(solutinFilePath); if (!isSolutinFileExists) { var message = "The '" + solutinFilePath + "' not exists."; Debug.Assert(isSolutinFileExists, message); // ReSharper disable once HeuristicUnreachableCode throw new ApplicationException(message); } SolutinFilePath = solutinFilePath; RootFolder = Path.GetDirectoryName(solutinFilePath); var suits = File.ReadAllLines(solutinFilePath); var rootDir = Path.GetDirectoryName(solutinFilePath); Debug.Assert(rootDir != null, "rootDir != null"); TestSuits = new ObservableCollection<TestSuitVm>(); foreach (var aSuit in suits) { var suit = aSuit.Trim(); if (string.IsNullOrEmpty(suit)) continue; var testSuit = new TestSuitVm(this, suit, config); if (selectePath != null) { if (testSuit.FullPath == selectePath) testSuit.IsSelected = true; // Прикольно что по другому фокус не изменить! else foreach (var test in testSuit.Tests) if (test.FullPath == selectePath) test.IsSelected = true; } } TestSuits.CollectionChanged += TestSuits_CollectionChanged; IsDirty = false; }
void item_Click(object sender, RoutedEventArgs e) { var rootDir = Path.GetDirectoryName(_solution.SolutinFilePath) ?? ""; var name = (string)((MenuItem)e.Source).Header; var testSuit = new TestSuitVm(_solution, name, _settings.Config); testSuit.IsSelected = true; _solution.Save(); }
private void EditTestSuit(bool create) { if (_solution == null) return; var currentTestSuit = _currentTestSuit; var dialog = new TestSuitDialog(create, currentTestSuit) { Owner = this }; if (dialog.ShowDialog() ?? false) { if (currentTestSuit != null) _solution.TestSuits.Remove(currentTestSuit); var testSuit = new TestSuitVm(_solution, dialog.TestSuitName, _settings.Config); testSuit.IsSelected = true; _solution.Save(); } }
private void _testsTreeView_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e) { var test = e.NewValue as TestVm; if (test != null) { _text.Text = test.Code; _currentTestSuit = test.TestSuit; ShowDiff(test); } var testSuit = e.NewValue as TestSuitVm; if (testSuit != null) { _text.Text = ""; _currentTestSuit = testSuit; _para.Inlines.Clear(); } SaveSelectedTestAndTestSuit(); _settings.Save(); }