IconInfo (final SMTestProxy testProxy, final TestConsoleProperties consoleProperties) { final TestStateInfo.Magnitude magnitude = testProxy.getMagnitudeInfo(); final boolean hasErrors = testProxy.hasErrors(); final boolean hasPassedTests = testProxy.hasPassedTests(); return switch (magnitude) { case ERROR_INDEX -> IconInfo.wrap(ERROR_ICON, SmRunnerBundle.message("sm.test.runner.ui.tests.tree.presentation.accessible.status.error")); case FAILED_INDEX -> hasErrors ? IconInfo.wrap(FAILED_E_ICON, SmRunnerBundle.message("sm.test.runner.ui.tests.tree.presentation.accessible.status.failed.with.errors")) : IconInfo.wrap(FAILED_ICON, SmRunnerBundle.message("sm.test.runner.ui.tests.tree.presentation.accessible.status.failed")); case IGNORED_INDEX -> hasErrors ? IconInfo.wrap(IGNORED_E_ICON, SmRunnerBundle.message("sm.test.runner.ui.tests.tree.presentation.accessible.status.ignored.with.errors")) : (hasPassedTests ? IconInfo.wrap(PASSED_IGNORED, SmRunnerBundle.message("sm.test.runner.ui.tests.tree.presentation.accessible.status.passed.with.ignored")) : IconInfo.wrap(IGNORED_ICON, SmRunnerBundle.message("sm.test.runner.ui.tests.tree.presentation.accessible.status.ignored"))); case NOT_RUN_INDEX -> IconInfo.wrap(NOT_RAN, SmRunnerBundle.message("sm.test.runner.ui.tests.tree.presentation.accessible.status.not.ran")); case COMPLETE_INDEX, PASSED_INDEX -> hasErrors ? IconInfo.wrap(PASSED_E_ICON, SmRunnerBundle.message("sm.test.runner.ui.tests.tree.presentation.accessible.status.passed.with.errors")) : IconInfo.wrap(PASSED_ICON, SmRunnerBundle.message("sm.test.runner.ui.tests.tree.presentation.accessible.status.passed")); case RUNNING_INDEX -> { if (consoleProperties.isPaused()) { yield hasErrors ? IconInfo.wrap(PAUSED_E_ICON, SmRunnerBundle.message("sm.test.runner.ui.tests.tree.presentation.accessible.status.paused.with.errors")) : IconInfo.wrap(AllIcons.RunConfigurations.TestPaused, SmRunnerBundle.message("sm.test.runner.ui.tests.tree.presentation.accessible.status.paused")); } else { yield hasErrors ? IconInfo.wrap(RUNNING_E_ICON, SmRunnerBundle.message("sm.test.runner.ui.tests.tree.presentation.accessible.status.running.with.errors")) : IconInfo.wrap(RUNNING_ICON, SmRunnerBundle.message("sm.test.runner.ui.tests.tree.presentation.accessible.status.running")); } } case SKIPPED_INDEX -> hasErrors ? IconInfo.wrap(SKIPPED_E_ICON, SmRunnerBundle.message("sm.test.runner.ui.tests.tree.presentation.accessible.status.skipped.with.errors")) : IconInfo.wrap(SKIPPED_ICON, SmRunnerBundle.message("sm.test.runner.ui.tests.tree.presentation.accessible.status.skipped")); case TERMINATED_INDEX -> hasErrors ? IconInfo.wrap(TERMINATED_E_ICON, SmRunnerBundle.message("sm.test.runner.ui.tests.tree.presentation.accessible.status.terminated.with.errors")) : IconInfo.wrap(TERMINATED_ICON, SmRunnerBundle.message("sm.test.runner.ui.tests.tree.presentation.accessible.status.terminated")); }; }