public void OnNavigatedTo(NavigationContext context) { try { _archiveType = (ArchiveType)context.Parameters["archiveType"]; _archiveFileName = (string)context.Parameters["archiveFileName"]; _testSession = Directory.Exists(_archiveFileName) ? _arkadeApi.CreateTestSession(ArchiveDirectory.Read(_archiveFileName, _archiveType)) : _arkadeApi.CreateTestSession(ArchiveFile.Read(_archiveFileName, _archiveType)); if (!_testSession.IsTestableArchive()) { _statusEventHandler.RaiseEventOperationMessage( Resources.GUI.TestrunnerArchiveTestability, string.Format(Resources.GUI.TestrunnerArchiveNotTestable, ArkadeProcessingArea.LogsDirectory), OperationMessageStatus.Warning ); } StartTestingCommand.RaiseCanExecuteChanged(); // testSession has been updated, reevaluate command } catch (Exception e) { string message = string.Format(Resources.GUI.ErrorReadingArchive, e.Message); Log.Error(e, message); _statusEventHandler.RaiseEventOperationMessage(null, message, OperationMessageStatus.Error); } }
private bool CanStartTestRun() { return(_testSession != null && _testSession.IsTestableArchive() && !_testRunHasBeenExecuted); }