private void RunTest() { TestLogLines.Clear(); LogUnsafe("Запуск теста", Colors.LimeGreen); AssociatedWithModelTest.BeginTest(() => { // TODO: test has been really started _uiNotifier.Notify(() => { IsRunningTest = true; }); }, (progress, stepResult, message) => { LogSafe(message, stepResult == TestSysStepResult.Good ? Colors.Lime : Colors.OrangeRed); } , testResult => { _uiNotifier.Notify(() => { try { switch (testResult) { case TestSysResult.Success: TestCompleteColor = Colors.Lime; break; case TestSysResult.Fail: TestCompleteColor = Colors.OrangeRed; break; case TestSysResult.Canceled: TestCompleteColor = Colors.Yellow; break; default: throw new ArgumentOutOfRangeException(nameof(testResult), testResult, null); } LogUnsafe("Тест завершен", TestCompleteColor); } catch (Exception e) { Console.WriteLine(e); LogSafe("Произошла ошибка при завершении тестирования: " + e.Message, Colors.OrangeRed); } finally { IsRunningTest = false; } }); }); }
private void CancelTest() { AssociatedWithModelTest.CancelCurrentTest(); }