├── .config
└── dotnet-tools.json
├── .editorconfig
├── .github
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ ├── feature_request.md
│ └── nunit-compatibility-issue.md
├── dependabot.yml
└── workflows
│ ├── codeql-analysis.yml
│ └── testcentric-gui-ci.yml
├── .travis.yml
├── CHANGES.txt
├── CONTRIBUTING.md
├── GitReleaseManager.yaml
├── GitVersion.yml
├── INSTALL.md
├── LICENSE.txt
├── NOTICES.txt
├── NuGet.config
├── README.md
├── ROADMAP.md
├── RunSummaryDisplay.cs
├── TestProject.nunit
├── VERSIONING.md
├── appveyor.yml
├── build.cake
├── build.cmd
├── build.ps1
├── build.sh
├── choco
├── VERIFICATION.txt
├── testcentric-agent-x86.exe.ignore
├── testcentric-agent.choco.addins
├── testcentric-agent.exe.ignore
└── testcentric.choco.addins
├── nuget
├── TestCentric.Engine.Api.nuspec
├── TestCentric.Engine.Core.nuspec
├── TestCentric.Metadata.nuspec
├── testcentric-agent.nuget.addins
└── testcentric.nuget.addins
├── nunit.ico
├── package-tests.cake
├── src
├── GuiException
│ ├── UiException
│ │ ├── CSharpParser
│ │ │ ├── CSCode.cs
│ │ │ ├── CSParser.cs
│ │ │ ├── CSToken.cs
│ │ │ ├── CSTokenCollection.cs
│ │ │ ├── LexToken.cs
│ │ │ ├── Lexer.cs
│ │ │ ├── TokenClassifier.cs
│ │ │ └── TokenDictionary.cs
│ │ ├── CodeFormatters
│ │ │ ├── CodeFormatterCollection.cs
│ │ │ ├── GeneralCodeFormatter.cs
│ │ │ ├── ICodeFormatter.cs
│ │ │ ├── IFormatterCatalog.cs
│ │ │ └── PlainTextCodeFormatter.cs
│ │ ├── Controls
│ │ │ ├── CodeBox.cs
│ │ │ ├── CodeRenderingContext.cs
│ │ │ ├── DefaultCodeRenderer.cs
│ │ │ ├── DefaultErrorListRenderer.cs
│ │ │ ├── ErrorBrowser.cs
│ │ │ ├── ErrorList.cs
│ │ │ ├── ErrorPanelLayout.cs
│ │ │ ├── ErrorToolbar.cs
│ │ │ ├── ICodeRenderer.cs
│ │ │ ├── ICodeView.cs
│ │ │ ├── IErrorDisplay.cs
│ │ │ ├── IErrorListRenderer.cs
│ │ │ ├── IStackTraceView.cs
│ │ │ ├── PaintLineLocation.cs
│ │ │ ├── SourceCodeDisplay.cs
│ │ │ ├── SplitterBox.cs
│ │ │ └── StackTraceDisplay.cs
│ │ ├── DefaultTextManager.cs
│ │ ├── ExceptionItem.cs
│ │ ├── ExceptionItemCollection.cs
│ │ ├── ITextManager.cs
│ │ ├── Properties
│ │ │ ├── Resources.Designer.cs
│ │ │ └── Resources.resx
│ │ ├── Resources
│ │ │ ├── ImageCopyToClipboard.png
│ │ │ ├── ImageErrorBrowserHeader.png
│ │ │ ├── ImageErrorList.png
│ │ │ ├── ImageReverseItemOrder.png
│ │ │ ├── ImageSourceCodeDisplay.png
│ │ │ ├── ImageSplitterBox.png
│ │ │ └── ImageStackTraceDisplay.png
│ │ ├── StackTraceParser.cs
│ │ ├── TraceExceptionHelper.cs
│ │ ├── data
│ │ │ ├── Image.png
│ │ │ ├── OneLine.txt
│ │ │ ├── Resource.cs
│ │ │ ├── StackTraceAnalysers
│ │ │ │ ├── FunctionParser.cs
│ │ │ │ ├── IErrorParser.cs
│ │ │ │ ├── LineNumberParser.cs
│ │ │ │ ├── PathCompositeParser.cs
│ │ │ │ ├── UnixPathParser.cs
│ │ │ │ └── WindowsPathParser.cs
│ │ │ ├── TextCode.cs
│ │ │ └── test.txt
│ │ └── nunit.uiexception.dll.csproj
│ └── tests
│ │ ├── CSharpParser
│ │ ├── TestCSCode.cs
│ │ ├── TestCSParser.cs
│ │ ├── TestLexer.cs
│ │ ├── TestToken.cs
│ │ ├── TestTokenClassifier.cs
│ │ └── TestTokenDictionary.cs
│ │ ├── CodeFormatters
│ │ ├── TestCodeFormatterCollection.cs
│ │ ├── TestGeneralCodeFormatter.cs
│ │ └── TestPlainTextCodeFormatter.cs
│ │ ├── Controls
│ │ ├── TestCodeBox.cs
│ │ ├── TestCodeRenderingContext.cs
│ │ ├── TestDefaultCodeRenderer.cs
│ │ ├── TestDefaultErrorListRenderer.cs
│ │ ├── TestErrorBrowser.cs
│ │ ├── TestErrorList.cs
│ │ ├── TestErrorPanelLayout.cs
│ │ ├── TestErrorToolbar.cs
│ │ ├── TestSourceCodeDisplay.cs
│ │ ├── TestSplitterBox.cs
│ │ └── TestStackTraceDisplay.cs
│ │ ├── Program.cs
│ │ ├── StackTraceAnalysers
│ │ ├── TestFunctionParser.cs
│ │ ├── TestIErrorParser.cs
│ │ ├── TestLineNumberParser.cs
│ │ ├── TestPathParser.cs
│ │ ├── TestUnixPathParser.cs
│ │ └── TestWindowsPathParser.cs
│ │ ├── TestDefaultTextManager.cs
│ │ ├── TestExceptionItem.cs
│ │ ├── TestExceptionItemCollection.cs
│ │ ├── TestPaintLineLocation.cs
│ │ ├── TestStackTraceParser.cs
│ │ ├── data
│ │ ├── Basic.cs
│ │ ├── HelloWorld.txt
│ │ ├── TestResource.cs
│ │ └── TextCode.txt
│ │ └── nunit.uiexception.tests.csproj
├── TestCentric
│ ├── testcentric.exe
│ │ ├── App.config
│ │ ├── App.manifest
│ │ ├── Class1.cs
│ │ └── TestCentric.Gui.Exe.csproj
│ ├── testcentric.gui
│ │ ├── AppEntry.cs
│ │ ├── Controls
│ │ │ ├── ExpandingLabel.cs
│ │ │ ├── ExpandingLabel.resx
│ │ │ ├── MethodInvocationHelper.cs
│ │ │ ├── StretchToolStripTextBox.cs
│ │ │ ├── TestCentricProgressBar.cs
│ │ │ ├── TipWindow.cs
│ │ │ └── TipWindow.resx
│ │ ├── DialogManager.cs
│ │ ├── Dialogs
│ │ │ ├── AboutBox.cs
│ │ │ ├── AboutBox.resx
│ │ │ ├── CategoryFilterDialog.Designer.cs
│ │ │ ├── CategoryFilterDialog.cs
│ │ │ ├── CategoryFilterDialog.resx
│ │ │ ├── ExtensionDialog.cs
│ │ │ ├── ExtensionDialog.resx
│ │ │ ├── ParameterDialog.Designer.cs
│ │ │ ├── ParameterDialog.cs
│ │ │ ├── ParameterDialog.resx
│ │ │ ├── PinnableDisplay.Designer.cs
│ │ │ ├── PinnableDisplay.cs
│ │ │ ├── PinnableDisplay.resx
│ │ │ ├── SettingsDialog.cs
│ │ │ ├── SettingsDialog.resx
│ │ │ ├── SettingsDialogBase.cs
│ │ │ ├── SettingsDialogBase.resx
│ │ │ ├── TestParametersDialog.Designer.cs
│ │ │ ├── TestParametersDialog.cs
│ │ │ ├── TestParametersDialog.resx
│ │ │ ├── TestPropertiesDialog.Designer.cs
│ │ │ ├── TestPropertiesDialog.cs
│ │ │ ├── TestPropertiesDialog.resx
│ │ │ ├── TreeBasedSettingsDialog.cs
│ │ │ ├── TreeBasedSettingsDialog.resx
│ │ │ ├── XmlDisplay.Designer.cs
│ │ │ └── XmlDisplay.cs
│ │ ├── Elements
│ │ │ ├── ControlElements
│ │ │ │ ├── ButtonElement.cs
│ │ │ │ ├── CheckBoxElement.cs
│ │ │ │ ├── ControlElement.cs
│ │ │ │ ├── KeyCommand.cs
│ │ │ │ ├── ListBoxElement.cs
│ │ │ │ ├── TabSelector.cs
│ │ │ │ └── TextBoxElement.cs
│ │ │ ├── ICategoryFilterSelection.cs
│ │ │ ├── IChanged.cs
│ │ │ ├── IChecked.cs
│ │ │ ├── ICommand.cs
│ │ │ ├── IControlElement.cs
│ │ │ ├── IKeyCommand.cs
│ │ │ ├── IListBox.cs
│ │ │ ├── IMultiSelection.cs
│ │ │ ├── IPopup.cs
│ │ │ ├── ISelection.cs
│ │ │ ├── IToolStripMenu.cs
│ │ │ ├── IToolTip.cs
│ │ │ ├── IViewElement.cs
│ │ │ ├── README.md
│ │ │ └── ToolStripElements
│ │ │ │ ├── CheckedMenuElement.cs
│ │ │ │ ├── CheckedToolStripMenuGroup.cs
│ │ │ │ ├── CommandMenuElement.cs
│ │ │ │ ├── MultiCheckedToolStripButtonGroup.cs
│ │ │ │ ├── PopupMenuElement.cs
│ │ │ │ ├── SplitButtonElement.cs
│ │ │ │ ├── ToolStripButtonElement.cs
│ │ │ │ ├── ToolStripCategoryFilterButton.cs
│ │ │ │ ├── ToolStripElement.cs
│ │ │ │ ├── ToolStripMenuElement.cs
│ │ │ │ └── ToolStripTextBoxElement.cs
│ │ ├── IDialogManager.cs
│ │ ├── ILongRunningOperationDisplay.cs
│ │ ├── IMessageDisplay.cs
│ │ ├── Images
│ │ │ ├── DebugTests.png
│ │ │ ├── Ellipsis.gif
│ │ │ ├── GroupBy_16x.png
│ │ │ ├── ResetFilter.png
│ │ │ ├── RunAllTests.png
│ │ │ ├── RunTests.png
│ │ │ ├── StopRun.png
│ │ │ ├── Stopwatch.png
│ │ │ ├── SummaryReport.png
│ │ │ ├── TestFilter.png
│ │ │ ├── Tree
│ │ │ │ ├── Circles
│ │ │ │ │ ├── Failure.png
│ │ │ │ │ ├── Ignored.png
│ │ │ │ │ ├── Inconclusive.png
│ │ │ │ │ ├── Running.png
│ │ │ │ │ ├── Skipped.png
│ │ │ │ │ ├── Success.png
│ │ │ │ │ └── Warning.png
│ │ │ │ ├── Classic
│ │ │ │ │ ├── Failure.png
│ │ │ │ │ ├── Ignored.png
│ │ │ │ │ ├── Inconclusive.png
│ │ │ │ │ ├── Running.png
│ │ │ │ │ ├── Skipped.png
│ │ │ │ │ ├── Success.png
│ │ │ │ │ └── Warning.png
│ │ │ │ └── Visual Studio
│ │ │ │ │ ├── Failure.png
│ │ │ │ │ ├── Ignored.png
│ │ │ │ │ ├── Inconclusive.png
│ │ │ │ │ ├── Running.png
│ │ │ │ │ ├── Skipped.png
│ │ │ │ │ ├── Success.png
│ │ │ │ │ └── Warning.png
│ │ │ ├── blank-stop-sign-256x256.png
│ │ │ ├── exit-button.png
│ │ │ ├── force-stop-icon.png
│ │ │ ├── forced-stop-256x256.png
│ │ │ ├── pinned.gif
│ │ │ ├── stop-sign-500x500.png
│ │ │ ├── testcentric_128x128.png
│ │ │ ├── testcentric_256x256.png
│ │ │ ├── testcentric_32x32.png
│ │ │ ├── testcentric_64x64.png
│ │ │ └── unpinned.gif
│ │ ├── LongRunningOperationDisplay.cs
│ │ ├── LongRunningOperationDisplay.resx
│ │ ├── MessageBoxDisplay.cs
│ │ ├── MessageBuilder.cs
│ │ ├── OutcomeImageSet.cs
│ │ ├── Presenters
│ │ │ ├── AgentSelectionController.cs
│ │ │ ├── CategoryGrouping.cs
│ │ │ ├── DisplayStrategy.cs
│ │ │ ├── DurationGrouping.cs
│ │ │ ├── ErrorsAndFailuresPresenter.cs
│ │ │ ├── FixtureListDisplayStrategy.cs
│ │ │ ├── GroupDisplayStrategy.cs
│ │ │ ├── ITreeDisplayStrategy.cs
│ │ │ ├── ITreeDisplayStrategyFactory.cs
│ │ │ ├── ImageSetManager.cs
│ │ │ ├── InitialTreeExpansion.cs
│ │ │ ├── NUnitGrouping
│ │ │ │ ├── CategoryGrouping.cs
│ │ │ │ ├── DurationGrouping.cs
│ │ │ │ ├── FoldNamespaceNodesHandler.cs
│ │ │ │ ├── GroupingBase.cs
│ │ │ │ ├── INUnitGrouping.cs
│ │ │ │ ├── INUnitTreeDisplayStrategy.cs
│ │ │ │ ├── OutcomeGrouping.cs
│ │ │ │ ├── ReGrouping.cs
│ │ │ │ ├── RegroupTestEventQueue.cs
│ │ │ │ ├── TreeNodeDurationHandler.cs
│ │ │ │ └── TreeNodeImageHandler.cs
│ │ │ ├── NUnitTreeDisplayStrategy.cs
│ │ │ ├── OutcomeGrouping.cs
│ │ │ ├── ProgressBarPresenter.cs
│ │ │ ├── StatusBarPresenter.cs
│ │ │ ├── TestCentricPresenter.cs
│ │ │ ├── TestGroup.cs
│ │ │ ├── TestGrouping.cs
│ │ │ ├── TestListDisplayStrategy.cs
│ │ │ ├── TestPropertiesPresenter.cs
│ │ │ ├── TestResultCounts.cs
│ │ │ ├── TestResultSubViewPresenter.cs
│ │ │ ├── TextOutputPresenter.cs
│ │ │ ├── TreeDisplayStrategyFactory.cs
│ │ │ ├── TreeViewNodeComparer.cs
│ │ │ └── TreeViewPresenter.cs
│ │ ├── Properties
│ │ │ ├── Resources.Designer.cs
│ │ │ └── Resources.resx
│ │ ├── Resources
│ │ │ └── picturebox1.Image.bmp
│ │ ├── SettingsPages
│ │ │ ├── AdvancedLoaderSettingsPage.cs
│ │ │ ├── AdvancedLoaderSettingsPage.resx
│ │ │ ├── AssemblyReloadSettingsPage.cs
│ │ │ ├── AssemblyReloadSettingsPage.resx
│ │ │ ├── GuiSettingsPage.cs
│ │ │ ├── GuiSettingsPage.resx
│ │ │ ├── ProjectEditorSettingsPage.Designer.cs
│ │ │ ├── ProjectEditorSettingsPage.cs
│ │ │ ├── ProjectEditorSettingsPage.resx
│ │ │ ├── SettingsPage.cs
│ │ │ ├── SettingsPage.resx
│ │ │ ├── TreeSettingsPage.cs
│ │ │ └── TreeSettingsPage.resx
│ │ ├── TestCentric.Gui.csproj
│ │ ├── TestCentricFormBase.cs
│ │ ├── TestNodeFilters.cs
│ │ ├── Views
│ │ │ ├── ErrorsAndFailuresView.Designer.cs
│ │ │ ├── ErrorsAndFailuresView.cs
│ │ │ ├── ErrorsAndFailuresView.resx
│ │ │ ├── IErrorsAndFailuresView.cs
│ │ │ ├── ILongRunningOperation.cs
│ │ │ ├── IMainView.cs
│ │ │ ├── IProgressBarView.cs
│ │ │ ├── IStatusBarView.cs
│ │ │ ├── ITestOutputSubView.cs
│ │ │ ├── ITestPropertiesVIew.cs
│ │ │ ├── ITestResultSubView.cs
│ │ │ ├── ITestTreeView.cs
│ │ │ ├── ITestsNotRunView.cs
│ │ │ ├── ITextOutputView.cs
│ │ │ ├── IView.cs
│ │ │ ├── IXmlView.cs
│ │ │ ├── ProgressBarView.Designer.cs
│ │ │ ├── ProgressBarView.cs
│ │ │ ├── ProgressBarView.resx
│ │ │ ├── StatusBarView.Designer.cs
│ │ │ ├── StatusBarView.cs
│ │ │ ├── StatusBarView.resx
│ │ │ ├── TestCentricMainView.cs
│ │ │ ├── TestCentricMainView.resx
│ │ │ ├── TestOutputSubView.Designer.cs
│ │ │ ├── TestOutputSubView.cs
│ │ │ ├── TestOutputSubView.resx
│ │ │ ├── TestPackageSubView.Designer.cs
│ │ │ ├── TestPackageSubView.cs
│ │ │ ├── TestPackageSubView.resx
│ │ │ ├── TestPropertiesSubView.Designer.cs
│ │ │ ├── TestPropertiesSubView.cs
│ │ │ ├── TestPropertiesSubView.resx
│ │ │ ├── TestPropertiesView.Designer.cs
│ │ │ ├── TestPropertiesView.cs
│ │ │ ├── TestPropertiesView.resx
│ │ │ ├── TestResultItem.cs
│ │ │ ├── TestResultSubView.Designer.cs
│ │ │ ├── TestResultSubView.cs
│ │ │ ├── TestResultSubView.resx
│ │ │ ├── TestTree.resx
│ │ │ ├── TestTreeView.Designer.cs
│ │ │ ├── TestTreeView.cs
│ │ │ ├── TestTreeView.resx
│ │ │ ├── TextOutputView.Designer.cs
│ │ │ ├── TextOutputView.cs
│ │ │ ├── TextOutputView.resx
│ │ │ └── UserControlView.cs
│ │ ├── VisualState.cs
│ │ ├── WaitCursor.cs
│ │ └── Xml2RtfConverter.cs
│ └── tests
│ │ ├── ControlTester.cs
│ │ ├── Controls
│ │ └── TestCentricProgressBarTests.cs
│ │ ├── Dialogs
│ │ └── DialogCreationTests.cs
│ │ ├── FakeUserSettings.cs
│ │ ├── OutcomeImageSetTests.cs
│ │ ├── Presenters
│ │ ├── CategoryGroupingTests.cs
│ │ ├── DurationGroupingTests.cs
│ │ ├── ErrorsAndFailuresPresenterTests.cs
│ │ ├── FixtureListDisplayStrategyTests.cs
│ │ ├── ImageSetManagerTests.cs
│ │ ├── Main
│ │ │ ├── CommandTests.cs
│ │ │ ├── MainPresenterTestBase.cs
│ │ │ ├── PackageSettingsTests.cs
│ │ │ ├── ProjectEventTests.cs
│ │ │ ├── WhenPresenterIsCreated.cs
│ │ │ ├── WhenSettingsChanged.cs
│ │ │ ├── WhenTestRunBegins.cs
│ │ │ ├── WhenTestRunCompletes.cs
│ │ │ ├── WhenTestsAreLoaded.cs
│ │ │ ├── WhenTestsAreLoading.cs
│ │ │ ├── WhenTestsAreReloaded.cs
│ │ │ └── WhenTestsAreUnloaded.cs
│ │ ├── NUnitGrouping
│ │ │ ├── CategoryGroupingTests.cs
│ │ │ ├── DurationGroupingTests.cs
│ │ │ ├── FoldNamespaceNodesHandlerTests.cs
│ │ │ ├── OutcomeGroupingTests.cs
│ │ │ ├── TreeNodeDurationHandlerTests.cs
│ │ │ └── TreeNodeImageHandlerTests.cs
│ │ ├── NUnitTreeDisplayStrategyTests.cs
│ │ ├── OutcomeGroupingTests.cs
│ │ ├── PresenterTestBase.cs
│ │ ├── ProgressBarPresenterTests.cs
│ │ ├── StatusBarPresenterTests.cs
│ │ ├── TestGroupTests.cs
│ │ ├── TestListDisplayStrategyTests.cs
│ │ ├── TestPropertiesPresenterTests.cs
│ │ ├── TestResultCountsTests.cs
│ │ ├── TestResultSubViewPresenterTests.cs
│ │ ├── TestTree
│ │ │ ├── TestExecutionTests.cs
│ │ │ ├── TestSelection_WithCheckboxes.cs
│ │ │ ├── TestSelection_WithoutCheckboxes.cs
│ │ │ ├── TreeViewPresenterTestBase.cs
│ │ │ ├── TreeViewPresenterTests.cs
│ │ │ ├── WhenPresenterIsCreated.cs
│ │ │ ├── WhenTestCaseCompletes.cs
│ │ │ ├── WhenTestRunBegins.cs
│ │ │ ├── WhenTestRunCompletes.cs
│ │ │ ├── WhenTestSuiteCompletes.cs
│ │ │ ├── WhenTestsAreLoaded.cs
│ │ │ ├── WhenTestsAreReloaded.cs
│ │ │ └── WhenTestsAreUnloaded.cs
│ │ ├── TextOutputPresenterTests.cs
│ │ └── TreeViewNodeComparerTests.cs
│ │ ├── Program.cs
│ │ ├── TestCentric.Gui.Tests.addins
│ │ ├── TestCentric.Gui.Tests.csproj
│ │ ├── TextOutputDisplayTests.cs
│ │ ├── TreeViewExtensions.cs
│ │ ├── Views
│ │ ├── CommonViewTests.cs
│ │ ├── ErrorsAndFailuresViewTests.cs
│ │ ├── TestCentricMainViewTests.cs
│ │ └── TestResultItemTests.cs
│ │ ├── VisualStateSerializationTests.cs
│ │ ├── VisualStateTestBase.cs
│ │ ├── VisualStateTestData.cs
│ │ ├── VisualStateTests.cs
│ │ └── XmlRtfConverterTests.cs
├── TestModel
│ ├── model
│ │ ├── AssertionResult.cs
│ │ ├── CommandLineOptions.cs
│ │ ├── EnginePackageSettings.cs
│ │ ├── Filter
│ │ │ ├── CategoryFilter.cs
│ │ │ ├── ITestCentricTestFilter.cs
│ │ │ ├── ITestFilter.cs
│ │ │ ├── OutcomeFilter.cs
│ │ │ ├── TestCentricTestFilter.cs
│ │ │ └── TextFilter.cs
│ │ ├── ITestEvents.cs
│ │ ├── ITestItem.cs
│ │ ├── ITestModel.cs
│ │ ├── ITestServices.cs
│ │ ├── InternalTrace.cs
│ │ ├── InternalTraceWriter.cs
│ │ ├── Logger.cs
│ │ ├── ResultNode.cs
│ │ ├── ResultState.cs
│ │ ├── ResultSummary.cs
│ │ ├── ResultSummaryCreator.cs
│ │ ├── RunState.cs
│ │ ├── Services
│ │ │ ├── AssemblyWatcher.cs
│ │ │ ├── IAsemblyWatcher.cs
│ │ │ ├── RecentFiles.cs
│ │ │ └── SettingsService.cs
│ │ ├── Settings
│ │ │ ├── EngineSettings.cs
│ │ │ ├── ErrorDisplaySettings.cs
│ │ │ ├── GuiSettings.cs
│ │ │ ├── ISettings.cs
│ │ │ ├── MainFormSettings.cs
│ │ │ ├── MiniFormSettings.cs
│ │ │ ├── RecentProjectsSettings.cs
│ │ │ ├── SettingsGroup.cs
│ │ │ ├── SettingsStore.cs
│ │ │ ├── TestTreeSettings.cs
│ │ │ ├── TextOutputSettings.cs
│ │ │ └── UserSettings.cs
│ │ ├── TestCentric.Gui.Model.csproj
│ │ ├── TestCentricProject.cs
│ │ ├── TestEngineActivator.cs
│ │ ├── TestEventArgs.cs
│ │ ├── TestEventDispatcher.cs
│ │ ├── TestFilter.cs
│ │ ├── TestModel.cs
│ │ ├── TestModelBuilder.cs
│ │ ├── TestNode.cs
│ │ ├── TestSelection.cs
│ │ ├── TestServices.cs
│ │ ├── TestStartNotice.cs
│ │ ├── TestStatus.cs
│ │ └── XmlHelper.cs
│ └── tests
│ │ ├── AvailableRuntimesTest.cs
│ │ ├── CommandLineTests.cs
│ │ ├── CreateNewProjectTests.cs
│ │ ├── Fakes
│ │ ├── AvailableRuntimesService.cs
│ │ ├── ExtensionService.cs
│ │ ├── MockTestEngine.cs
│ │ ├── ResultService.cs
│ │ ├── RuntimeFramework.cs
│ │ ├── ServiceLocator.cs
│ │ └── TestAgentInfoService.cs
│ │ ├── Filter
│ │ ├── CategoryFilterTests.cs
│ │ ├── OutcomeFilterTests.cs
│ │ ├── TestCentricTestFilterTests.cs
│ │ └── TextFilterTests.cs
│ │ ├── Program.cs
│ │ ├── ResultNodeTests.cs
│ │ ├── ResultStateTests.cs
│ │ ├── ResultSummaryCreatorTests.cs
│ │ ├── Services
│ │ ├── AssemblyWatcherTests.cs
│ │ ├── RecentFilesTests.cs
│ │ └── SettingsServiceTests.cs
│ │ ├── Settings
│ │ ├── FakeSettingsService.cs
│ │ ├── SettingsGroupTests.cs
│ │ ├── SettingsStoreTests.cs
│ │ └── SettingsTests.cs
│ │ ├── TestCentric.Gui.Model.Tests.csproj
│ │ ├── TestExecutionTests.cs
│ │ ├── TestFilterTests.cs
│ │ ├── TestModelAssemblyTests.cs
│ │ ├── TestModelCreationTests.cs
│ │ ├── TestModelTests.cs
│ │ ├── TestNodeTests.cs
│ │ └── TestSelectionTests.cs
├── testcentric.snk
└── tests
│ ├── aspnetcore-test
│ ├── AspNetCoreTest.cs
│ └── aspnetcore-test.csproj
│ ├── hung-tests
│ ├── FastFixture.cs
│ ├── HangingFixture.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── SlowFixture.cs
│ └── hung-tests.csproj
│ ├── mock-assembly-v2
│ ├── MockAssembly.cs
│ └── mock-assembly-v2.csproj
│ ├── mock-assembly-x86
│ ├── MockAssembly.cs
│ └── mock-assembly-x86.csproj
│ ├── mock-assembly
│ ├── MockAssembly.cs
│ └── mock-assembly.csproj
│ └── windows-forms-test
│ ├── WindowsFormsTest.cs
│ └── windows-forms-test.csproj
├── testcentric-gui.sln
├── testcentric-gui.sln.licenseheader
├── testcentric.ico
├── testcentric.png
└── tools
└── packages.config
/.config/dotnet-tools.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | "isRoot": true,
4 | "tools": {
5 | "cake.tool": {
6 | "version": "5.0.0",
7 | "commands": [
8 | "dotnet-cake"
9 | ]
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 | 1. Go to '...'
16 | 2. Click on '....'
17 | 3. Scroll down to '....'
18 | 4. See error
19 |
20 | **Expected behavior**
21 | A clear and concise description of what you expected to happen.
22 |
23 | **Screenshots**
24 | If the bug is visual in nature, add screenshots to help explain your problem.
25 |
26 | **Environment (please complete the following information):**
27 | - TestCentric Version [e.g. 1.4.1]
28 | - OS: [e.g. iOS]
29 | - Target Runtime for your test assembly: [e.g. .NET Framework 4.7.2, .NET Core 3.1]
30 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/nunit-compatibility-issue.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: NUnit Compatibility Issue
3 | about: For use by the TestCentric / NUnit Engine Compatibility Team
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | ### NUnit Compatibility Issue
11 |
12 |
13 |
14 |
15 |
16 | __Category:__ API | Platform Support | Services | Functionality | Implementation | Build
17 | __Visibility:__ Users | Third-party Developers | Engine Extenders | Internal
18 | __Resolution:__ Pending | No Action | Fix in TestCentric | Fix in NUnit
19 |
20 | #### Description
21 |
22 | Describe the nature of the compatibility problem.
23 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | # To get started with Dependabot version updates, you'll need to specify which
2 | # package ecosystems to update and where the package manifests are located.
3 | # Please see the documentation for all configuration options:
4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5 |
6 | version: 2
7 | updates:
8 | - package-ecosystem: "nuget"
9 | directory: "/" # Location of package manifests
10 | schedule:
11 | interval: "weekly"
12 | ignore:
13 | - dependency-name: NUnit
14 | - dependency-name: NUnitLite
15 | - dependency-name: NUnit.Extension.*
16 | - dependency-name: TestCentric.*
17 |
--------------------------------------------------------------------------------
/.github/workflows/testcentric-gui-ci.yml:
--------------------------------------------------------------------------------
1 | name: TestCentric.GuiRunner.CI
2 |
3 | on:
4 | workflow_dispatch:
5 | pull_request:
6 | push:
7 |
8 | jobs:
9 | ContinuousIntegration:
10 | uses: TestCentric/TestCentric.Workflows/.github/workflows/testcentric-ci.yml@main
11 | secrets: inherit
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: csharp
2 | sudo: false
3 | dotnet: 2.1.502
4 |
5 | matrix:
6 | include:
7 | - mono: latest
8 | - mono: 5.10.1
9 | # Drop temporarily - can't build engine this way because projects use new format.
10 | # - mono: 4.6.2
11 | # env: USE_XBUILD=1
12 | allow_failures:
13 | - mono: latest
14 |
15 | script:
16 | - git fetch --unshallow
17 | - dotnet tool install --version "0.33.0" -g Cake.Tool
18 | - ~/.dotnet/tools/dotnet-cake --target=Travis --configuration=Release
19 |
--------------------------------------------------------------------------------
/CHANGES.txt:
--------------------------------------------------------------------------------
1 | For the latest list of changes to the TestCentric Runner, please see the
2 | release notes at https://test-centric.org/testcentric-gui/release-notes.html
3 |
--------------------------------------------------------------------------------
/GitVersion.yml:
--------------------------------------------------------------------------------
1 | next-version: 2.0.0
2 | mode: ContinuousDelivery
3 | legacy-semver-padding: 5
4 | build-metadata-padding: 5
5 | commits-since-version-source-padding: 5
6 | branches:
7 | master:
8 | regex: ^main$
9 | tag: dev
10 | release:
11 | tag: pre
12 | pull-request:
13 | tag: pr
14 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | cCopyright (c) 2018-2019 Charlie Poole
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
21 |
--------------------------------------------------------------------------------
/NOTICES.txt:
--------------------------------------------------------------------------------
1 | The TestCentric GUI Runner 1.0 is based in part on the NUnit 2.x GUI Runner,
2 | with portions of the code...
3 |
4 | Copyright (c) 2002-2014 Charlie Poole or
5 | Copyright (c) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov or
6 | Copyright (c) 2000-2002 Philip A. Craig
7 |
8 | The TestCentric GUI Runner uses the NUnit 3 Test Engine to run tests...
9 |
10 | Copyright (c) 2017-2019 Charlie Poole, Rob Prouse
--------------------------------------------------------------------------------
/NuGet.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ROADMAP.md:
--------------------------------------------------------------------------------
1 | # TestCentric "Roadmap"
2 |
3 | Speed of development of the TestCentric GUI varies as contributors have more or less time available and as various new needs are discovered. That's why we put "Roadmap" in quotes. Nevertheless, at any point in time, we do know what we are working on, what we expect to work on next and what we hope to work on in the more distant future.
4 |
5 | This roadmap was updated on 16 November 2019. "Near Term" means through 2019. "Medium Term" means the first quarter of 2020. "Long Term" means the rest of 2020. Of course, it all depends on who is available to work on the project and one way to accelerate development in the areas that interest you is to volunteer!
6 |
7 | ## Near Term
8 |
9 | * Backend Improvements
10 | - Remove dependency on NUnit Engine
11 | - Support running tests under .NET Core
12 | - Save and restore `TestPackages`.
13 | * GUI Improvements
14 | - Minor standard GUI enhancements
15 | - Bring Experimental GUI up to same feature set as standard GUI.
16 |
17 | ## Medium Term
18 | * Backend Improvements
19 | - Support for additional test platforms
20 | * GUI Improvements
21 | - Limited Enhancements to version 1.x - defer most to version 2
22 | * Version 2.0
23 | - Select technology (e.g. WPF, Xamarin, other) for version 2 of the GUI
24 | - Experiment with Visual Studio integration (adapter? extension?)
25 | - Create project and start work
26 |
27 | ## Long Term
28 | * Version 2.0 GUI Release
29 | - Continued support for Version 1.x through the year
30 | * TestCentric extension and / or adapter for Visual Studio
31 | * TestCentric console runner
32 | * TestCentric framework
33 |
--------------------------------------------------------------------------------
/RunSummaryDisplay.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | public class RunSummaryDisplay : Form
4 | {
5 | public RunSumarryDisplay()
6 | {
7 | InitializeComponent();
8 | }
9 |
10 | private void InitializeComponent()
11 | {
12 | this.SuspendLayout();
13 |
14 | //
15 | // RunSummaryDisplay
16 | //
17 | this.BackColor = System.Drawing.Color.LightYellow;
18 | this.ClientSize = new System.Drawing.Size(320, 60);
19 | this.ControlBox = false;
20 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
21 | this.MaximizeBox = false;
22 | this.MinimizeBox = false;
23 | this.Name = "RunSummaryDisplay";
24 | this.ShowInTaskbar = false;
25 | this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
26 | this.ResumeLayout(false);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/TestProject.nunit:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/appveyor.yml:
--------------------------------------------------------------------------------
1 | image: Previous Visual Studio 2022
2 |
3 | build_script:
4 | - cmd: dotnet --info
5 | - ps: .\build.ps1 --Target=ContinuousIntegration --Configuration=Release
6 |
7 | # disable built-in tests.
8 | test: false
9 |
10 | artifacts:
11 | - path: package\*.nupkg
12 |
13 | environment:
14 | TESTCENTRIC_MYGET_API_KEY:
15 | secure: wtAvJDVl2tfwiVcyLExFHLvZVfUWiQRHsfdHBFCNEATeCHo1Nd8JP642PfY8xhji
16 | TESTCENTRIC_NUGET_API_KEY:
17 | secure: vwKyDjnG0Ghg8JnlNgwd4DH525DAvyGkrtOQmvCxgJx74BENK/vxoCwxCL7y0YIE
18 | TESTCENTRIC_CHOCO_API_KEY:
19 | secure: aDsu1U+umVYFVybjkBVtVQsatSj3QKbD7VkGQci9mNF3493g9Giao/GABISIaHjT
20 | GITHUB_PASSWORD:
21 | secure: 2eNz23Eb1L40g2LPmlPqog==
22 | GITHUB_ACCESS_TOKEN:
23 | secure: RJ6sKRBZzwXz8JQvj8zcp45mkHNDad1UlvmfCsiVx63V9/pXHcm2Y2Lg/G/Vyhlz
24 |
--------------------------------------------------------------------------------
/build.cmd:
--------------------------------------------------------------------------------
1 | @echo off
2 | powershell ./build.ps1 %CAKE_ARGS% %*
3 |
--------------------------------------------------------------------------------
/build.ps1:
--------------------------------------------------------------------------------
1 | $ErrorActionPreference = 'Continue'
2 |
3 | Set-Location -LiteralPath $PSScriptRoot
4 |
5 | $env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = '1'
6 | $env:DOTNET_CLI_TELEMETRY_OPTOUT = '1'
7 | $env:DOTNET_NOLOGO = '1'
8 |
9 | dotnet tool restore
10 | if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
11 |
12 | dotnet cake @args
13 | if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
14 |
--------------------------------------------------------------------------------
/build.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | set -euox pipefail
3 |
4 | cd "$(dirname "${BASH_SOURCE[0]}")"
5 |
6 | export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
7 | export DOTNET_CLI_TELEMETRY_OPTOUT=1
8 | export DOTNET_NOLOGO=1
9 |
10 | dotnet tool restore
11 |
12 | dotnet cake "$@"
13 |
--------------------------------------------------------------------------------
/choco/VERIFICATION.txt:
--------------------------------------------------------------------------------
1 | VERIFICATION
2 | Verification is intended to assist the Chocolatey moderators and community
3 | in verifying that this package's contents are trustworthy.
4 |
5 | This package is published by the author of the software, Charlie Poole.
6 | Any binaries will be identical to other package types published by the
7 | author at https://github.com/TestCentric/testcentric-gui.
8 |
--------------------------------------------------------------------------------
/choco/testcentric-agent-x86.exe.ignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/choco/testcentric-agent-x86.exe.ignore
--------------------------------------------------------------------------------
/choco/testcentric-agent.choco.addins:
--------------------------------------------------------------------------------
1 | ../../ # Refer to root directory, where primary addins file is located
2 |
--------------------------------------------------------------------------------
/choco/testcentric-agent.exe.ignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/choco/testcentric-agent.exe.ignore
--------------------------------------------------------------------------------
/choco/testcentric.choco.addins:
--------------------------------------------------------------------------------
1 | ../../nunit-extension-*/tools/ # find extensions installed under chocolatey
2 | ../../../nunit-extension-*/tools/
3 | ../../testcentric-extension-*/tools/ # find extensions installed under chocolatey
4 | ../../../testcentric-extension-*/tools/
5 |
--------------------------------------------------------------------------------
/nuget/TestCentric.Engine.Api.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | TestCentric.Engine.Api
6 | 0.0.0
7 | This package includes the testcentric.agent.api assembly, used in creating pluggable agents.
8 | Charlie Poole
9 | Charlie Poole
10 | http://test-centric.org
11 | MIT
12 | https://cdn.rawgit.com/TestCentric/resources/main/images/icon/nunit_256.png
13 | testcentric.png
14 | false
15 | https://raw.githubusercontent.com/TestCentric/testcentric-gui/main/CHANGES.txt
16 | Copyright (c) 2018-2020 Charlie Poole
17 | en-US
18 | testcentric nunit gui runner test centric testing tdd pluggable agent
19 |
20 | TestCentric Agent Api Assembly
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/nuget/TestCentric.Metadata.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | TestCentric.Metadata
6 | 0.0.0
7 | This package includes the TestCentric metadata assembly, which forms part of the TestCentric engine. It is provided in a separate package for the benefit of other projects, which may find it useful.
8 | Charlie Poole
9 | Charlie Poole
10 | http://test-centric.org
11 | MIT
12 | https://cdn.rawgit.com/TestCentric/resources/main/images/icon/nunit_256.png
13 | testcentric.png
14 | false
15 | https://raw.githubusercontent.com/TestCentric/testcentric-gui/main/CHANGES.txt
16 | Copyright (c) 2018-2020 Charlie Poole
17 | en-US
18 | testcentric nunit gui runner test centric testing tdd metadata mono cecil
19 |
20 | TestCentric Metadata Assembly
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/nuget/testcentric-agent.nuget.addins:
--------------------------------------------------------------------------------
1 | ../../ # Refer to root directory, where primary addins file is located
2 |
--------------------------------------------------------------------------------
/nuget/testcentric.nuget.addins:
--------------------------------------------------------------------------------
1 | ../../NUnit.Extension.*/**/tools/ # nuget v2 layout
2 | ../../../NUnit.Extension.*/**/tools/ # nuget v3 layout
3 | ../../TestCentric.Extension.*/**/tools/ # nuget v2 layout
4 | ../../../TestCentric.Extension.*/**/tools/ # nuget v3 layout
5 |
--------------------------------------------------------------------------------
/nunit.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/nunit.ico
--------------------------------------------------------------------------------
/src/GuiException/UiException/CodeFormatters/ICodeFormatter.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | namespace NUnit.UiException.CodeFormatters
7 | {
8 | ///
9 | /// ICodeFormatter is the interface to make the syntax
10 | /// coloring of a string for a specific developpment language.
11 | ///
12 | public interface ICodeFormatter
13 | {
14 | ///
15 | /// The language name handled by this formatter.
16 | /// Ex: "C#", "Java", "C++" and so on...
17 | ///
18 | string Language { get; }
19 |
20 | ///
21 | /// Makes the coloring syntax of the given text.
22 | ///
23 | /// The text to be formatted. This
24 | /// parameter cannot be null.
25 | /// A FormattedCode instance.
26 | FormattedCode Format(string code);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/GuiException/UiException/CodeFormatters/IFormatterCatalog.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | namespace NUnit.UiException.CodeFormatters
7 | {
8 | ///
9 | /// The interface through which SourceCodeDisplay interacts to guess
10 | /// the language from a file extension.
11 | ///
12 | /// Direct implementation is:
13 | /// - GeneralCodeFormatter
14 | ///
15 | public interface IFormatterCatalog
16 | {
17 | ///
18 | /// Format the text using the given language formatting.
19 | ///
20 | /// A text to be formatted
21 | /// The language with which formatting the text
22 | /// A FormatterCode object
23 | FormattedCode Format(string text, string language);
24 |
25 | ///
26 | /// Gets the language from the given extension.
27 | ///
28 | /// An extension without the dot, like 'cs'
29 | /// A language name, like 'C#'
30 | string LanguageFromExtension(string extension);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/GuiException/UiException/Controls/ICodeRenderer.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Drawing;
7 | using NUnit.UiException.CodeFormatters;
8 |
9 | namespace NUnit.UiException.Controls
10 | {
11 | ///
12 | /// The interface through which CodeBox interacts with a display to display itself.
13 | ///
14 | /// Direct implementation is:
15 | /// - DefaultCodeRenderer
16 | ///
17 | public interface ICodeRenderer
18 | {
19 | ///
20 | /// Draw the given code to be displayed in the actual viewport.
21 | ///
22 | /// The code to draw
23 | /// Encapsulate graphic information about how to display the code
24 | /// The portion of interest
25 | void DrawToGraphics(FormattedCode code, CodeRenderingContext args, Rectangle viewport);
26 |
27 | ///
28 | /// Measures the code size in pixels.
29 | ///
30 | /// The code to measure
31 | /// The target graphics object
32 | /// The font with which displaying the code
33 | /// The size in pixels
34 | SizeF GetDocumentSize(FormattedCode code, Graphics g, Font font);
35 |
36 | ///
37 | /// Converts a line index to its matching Y client coordinate.
38 | ///
39 | /// The line index to convert
40 | /// The target graphics object
41 | /// The font with which displaying the code
42 | /// The Y client coordinate
43 | float LineIndexToYCoordinate(int lineIndex, Graphics g, Font font);
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/GuiException/UiException/Controls/ICodeView.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using NUnit.UiException.CodeFormatters;
7 |
8 | namespace NUnit.UiException.Controls
9 | {
10 | ///
11 | /// The interface through which SourceCodeDisplay interacts with the code display.
12 | ///
13 | /// Direct implementation is:
14 | /// - CodeBox
15 | ///
16 | public interface ICodeView
17 | {
18 | ///
19 | /// Gets or sets a text to display in the code display.
20 | ///
21 | string Text { get; set; }
22 |
23 | ///
24 | /// Gets or sets the language formatting of the code display.
25 | ///
26 | string Language { get; set; }
27 |
28 | ///
29 | /// Gets or sets the viewport location from a 0 based line index
30 | ///
31 | int CurrentLine { get; set; }
32 |
33 | ///
34 | /// Gives access to the underlying IFormatterCatalog.
35 | ///
36 | IFormatterCatalog Formatter { get; }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/GuiException/UiException/Controls/IErrorDisplay.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Windows.Forms;
7 |
8 | namespace NUnit.UiException.Controls
9 | {
10 | ///
11 | /// This interface describes a feature that can be added to the ErrorWindow
12 | /// in order to show relevant information about failures/errors after a
13 | /// test suite run.
14 | /// Clients who wants to add their own display should implement this
15 | /// interface and register their instance to ErrorBrowser at run-time.
16 | ///
17 | /// Direct known implementations are:
18 | /// StackTraceDisplay
19 | /// SourceCodeDisplay
20 | ///
21 | public interface IErrorDisplay
22 | {
23 | ///
24 | /// Gives access to the ToolStripButton that enables this display.
25 | ///
26 | ToolStripButton PluginItem { get; }
27 |
28 | ///
29 | /// Gives access to a possibly null collection of option controls that will
30 | /// be shown when this display has the focus.
31 | ///
32 | ToolStripItem[] OptionItems { get; }
33 |
34 | ///
35 | /// Gives access to the content control of this display.
36 | ///
37 | Control Content { get; }
38 |
39 | ///
40 | /// Called whenever the user changes the error selection in the detail list.
41 | /// This method is called to allow the display to update its content according
42 | /// the given stack trace.
43 | ///
44 | ///
45 | void OnStackTraceChanged(string stackTrace);
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/GuiException/UiException/Controls/IStackTraceView.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System;
7 |
8 | namespace NUnit.UiException.Controls
9 | {
10 | ///
11 | /// This enum defines indicators telling how instances of IStackTraceView
12 | /// should deal with item order in their list.
13 | ///
14 | public enum ErrorListOrderPolicy
15 | {
16 | ///
17 | /// Tells IStackTraceView to order items in the list in the same
18 | /// order they appear in the stack trace.
19 | ///
20 | InitialOrder,
21 |
22 | ///
23 | /// Tells IStackTraceView to order items in the list in the reverse
24 | /// order they appear in the stack trace. At Test Driven Development time
25 | /// this value is useful to point out the location where a test is expected
26 | /// to fail.
27 | ///
28 | ReverseOrder,
29 | }
30 |
31 | ///
32 | /// The interface through which SourceCodeDisplay interacts with the error list.
33 | ///
34 | /// Direct implementations are:
35 | /// - ErrorList
36 | ///
37 | public interface IStackTraceView
38 | {
39 | event EventHandler SelectedItemChanged;
40 |
41 | string StackTrace { get; set; }
42 | ErrorItem SelectedItem { get; }
43 | bool AutoSelectFirstItem { get; set; }
44 | ErrorListOrderPolicy ListOrderPolicy { get; set; }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/GuiException/UiException/ITextManager.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System;
7 | using System.Collections.Generic;
8 | using System.Text;
9 |
10 | namespace NUnit.UiException
11 | {
12 | ///
13 | /// Provides an abstract way to manipulate a text as a whole and as separate
14 | /// sequences that can randomly be accessed one line at a time.
15 | ///
16 | public interface ITextManager
17 | {
18 | ///
19 | /// Gets the number of line in text managed by this object.
20 | ///
21 | int LineCount { get; }
22 |
23 | ///
24 | /// Gets the character count of the longest line in the text managed
25 | /// by this object.
26 | ///
27 | int MaxLength { get; }
28 |
29 | ///
30 | /// Gets the complete text managed by this object.
31 | ///
32 | string Text { get; }
33 |
34 | ///
35 | /// Gets a string filled with all characters in the line
36 | /// at the specified startingPosition without the trailing '\r\n' characters.
37 | ///
38 | ///
39 | ///
40 | string GetTextAt(int lineIndex);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/GuiException/UiException/Resources/ImageCopyToClipboard.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/GuiException/UiException/Resources/ImageCopyToClipboard.png
--------------------------------------------------------------------------------
/src/GuiException/UiException/Resources/ImageErrorBrowserHeader.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/GuiException/UiException/Resources/ImageErrorBrowserHeader.png
--------------------------------------------------------------------------------
/src/GuiException/UiException/Resources/ImageErrorList.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/GuiException/UiException/Resources/ImageErrorList.png
--------------------------------------------------------------------------------
/src/GuiException/UiException/Resources/ImageReverseItemOrder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/GuiException/UiException/Resources/ImageReverseItemOrder.png
--------------------------------------------------------------------------------
/src/GuiException/UiException/Resources/ImageSourceCodeDisplay.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/GuiException/UiException/Resources/ImageSourceCodeDisplay.png
--------------------------------------------------------------------------------
/src/GuiException/UiException/Resources/ImageSplitterBox.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/GuiException/UiException/Resources/ImageSplitterBox.png
--------------------------------------------------------------------------------
/src/GuiException/UiException/Resources/ImageStackTraceDisplay.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/GuiException/UiException/Resources/ImageStackTraceDisplay.png
--------------------------------------------------------------------------------
/src/GuiException/UiException/data/Image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/GuiException/UiException/data/Image.png
--------------------------------------------------------------------------------
/src/GuiException/UiException/data/OneLine.txt:
--------------------------------------------------------------------------------
1 | Hi, there!
--------------------------------------------------------------------------------
/src/GuiException/UiException/data/Resource.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace NUnit.UiException.Tests.data
6 | {
7 | public class Resource
8 | {
9 | public const string HelloWorld_txt = "HelloWorld.txt";
10 | public const string TextCode_cs = "TextCode.cs";
11 | public const string Image_png = "Image.png";
12 | public const string OneLine_txt = "OneLine.txt";
13 |
14 | public static string GetFilename(string filename)
15 | {
16 | string path;
17 |
18 | path = System.IO.Path.Combine(
19 | AppDomain.CurrentDomain.BaseDirectory,
20 | "..\\..\\data\\");
21 |
22 | path = System.IO.Path.GetFullPath(path);
23 |
24 | path += filename;
25 |
26 | return (path);
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/GuiException/UiException/data/StackTraceAnalysers/IErrorParser.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | namespace NUnit.UiException.StackTraceAnalyzers
7 | {
8 | public class RawError
9 | {
10 | private string _function;
11 | private string _path;
12 | private int _line;
13 | private string _input;
14 |
15 | public RawError(string input)
16 | {
17 | UiExceptionHelper.CheckNotNull(input, "input");
18 | _input = input;
19 |
20 | return;
21 | }
22 |
23 | public string Input
24 | {
25 | get { return (_input); }
26 | }
27 |
28 | public string Function
29 | {
30 | get { return (_function); }
31 | set { _function = value; }
32 | }
33 |
34 | public string Path
35 | {
36 | get { return (_path); }
37 | set { _path = value; }
38 | }
39 |
40 | public int Line
41 | {
42 | get { return (_line); }
43 | set { _line = value; }
44 | }
45 |
46 | public ErrorItem ToErrorItem()
47 | {
48 | UiExceptionHelper.CheckTrue(
49 | _function != null,
50 | "Cannot create instance of ErrorItem without a valid value in Function",
51 | "Function");
52 |
53 | return (new ErrorItem(_path, _function, _line));
54 | }
55 | }
56 |
57 | public interface IErrorParser
58 | {
59 | bool TryParse(StackTraceParser parser, RawError args);
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/src/GuiException/UiException/data/test.txt:
--------------------------------------------------------------------------------
1 | hi there
2 |
--------------------------------------------------------------------------------
/src/GuiException/UiException/nunit.uiexception.dll.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | NUnit.UiException
5 | nunit.uiexception
6 | net462
7 | ..\..\..\bin\$(Configuration)\
8 | false
9 | true
10 | true
11 | ..\..\testcentric.snk
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/GuiException/tests/CSharpParser/TestToken.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using NUnit.Framework;
7 | using NUnit.UiException.CodeFormatters;
8 |
9 | namespace NUnit.UiException.Tests.CodeFormatters
10 | {
11 | [TestFixture]
12 | public class TestToken
13 | {
14 | [Test]
15 | public void Test_Equals()
16 | {
17 | Assert.That(new TestingToken("text", 0, LexerTag.Text).Equals(null), Is.False);
18 | Assert.That(new TestingToken("text", 1, LexerTag.Text).Equals("text"), Is.False);
19 | Assert.That(new TestingToken("text", 0, LexerTag.Text).Equals(
20 | new TestingToken("", 0, LexerTag.Text)), Is.False);
21 | Assert.That(new TestingToken("text", 0, LexerTag.Text).Equals(
22 | new TestingToken("text", 1, LexerTag.Text)), Is.False);
23 | Assert.That(new TestingToken("text", 0, LexerTag.Text).Equals(
24 | new TestingToken("text", 0, LexerTag.SingleQuote)), Is.False);
25 | Assert.That(new TestingToken("text", 0, LexerTag.Text).Equals(
26 | new TestingToken("text", 0, LexerTag.Text)), Is.True);
27 |
28 | return;
29 | }
30 |
31 | #region TestingToken
32 |
33 | class TestingToken :
34 | LexToken
35 | {
36 | public TestingToken(string text, int start, LexerTag attr)
37 | {
38 | _text = text;
39 | _start = start;
40 | _tag = attr;
41 |
42 | return;
43 | }
44 | }
45 |
46 | #endregion
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/src/GuiException/tests/Program.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using NUnitLite;
7 |
8 | namespace TestCentric.Engine
9 | {
10 | class Program
11 | {
12 | static int Main(string[] args)
13 | {
14 | return new AutoRun().Execute(args);
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/GuiException/tests/StackTraceAnalysers/TestPathParser.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using NUnit.Framework;
7 | using NUnit.UiException.StackTraceAnalysers;
8 | using NUnit.UiException.StackTraceAnalyzers;
9 |
10 | namespace NUnit.UiException.Tests.StackTraceAnalyzers
11 | {
12 | [TestFixture]
13 | public class TestPathParser :
14 | TestIErrorParser
15 | {
16 | private PathCompositeParser _parser;
17 |
18 | [SetUp]
19 | public new void SetUp()
20 | {
21 | _parser = new PathCompositeParser();
22 |
23 | Assert.That(_parser.UnixPathParser, Is.Not.Null);
24 | Assert.That(_parser.WindowsPathParser, Is.Not.Null);
25 |
26 | return;
27 | }
28 |
29 | [Test]
30 | public void Test_Ability_To_Handle_Windows_Path_Like_Values()
31 | {
32 | RawError res;
33 |
34 | res = AcceptValue(_parser, "à get_Text() dans C:\\folder\\file1:line 1");
35 | Assert.That(res.Path, Is.EqualTo("C:\\folder\\file1"));
36 |
37 | return;
38 | }
39 |
40 | [Test]
41 | public void Test_Ability_To_Handle_Unix_Path_Like_Values()
42 | {
43 | RawError res;
44 |
45 | res = AcceptValue(_parser, "à get_Text() dans /home/ihottier/folder/file1:line 1");
46 | Assert.That(res.Path, Is.EqualTo("/home/ihottier/folder/file1"));
47 |
48 | return;
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/src/GuiException/tests/data/Basic.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | namespace Demo.data
7 | {
8 | class Basic { }
9 | }
10 |
--------------------------------------------------------------------------------
/src/GuiException/tests/data/HelloWorld.txt:
--------------------------------------------------------------------------------
1 | Hello world!
--------------------------------------------------------------------------------
/src/GuiException/tests/nunit.uiexception.tests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | NUnit.UiException.Tests
5 | nunit.uiexception.tests
6 | Exe
7 | net462
8 | ..\..\..\bin\$(Configuration)\
9 | false
10 | true
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.exe/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.exe/Class1.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System;
7 |
8 | namespace TestCentric.Gui
9 | {
10 | ///
11 | /// Summary description for Class1.
12 | ///
13 | public class Class1
14 | {
15 | ///
16 | /// The main entry point for the application.
17 | ///
18 | [STAThread]
19 | public static int Main(string[] args)
20 | {
21 | return AppEntry.Main(args);
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.exe/TestCentric.Gui.Exe.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | TestCentric.Gui
6 | testcentric
7 | net462
8 | ..\..\..\bin\$(Configuration)\
9 | false
10 | true
11 | TestCentric Runner
12 | GUI Runner Executable
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | ..\..\..\testcentric.ico
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | testcentric.ico
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Controls/MethodInvocationHelper.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Windows.Forms;
7 |
8 | namespace TestCentric.Gui.Controls
9 | {
10 | static public class MethodInvocationHelper
11 | {
12 | public static void InvokeIfRequired(this Control ctrl, MethodInvoker _delegate)
13 | {
14 | if (ctrl.InvokeRequired)
15 | ctrl.BeginInvoke(_delegate);
16 | else
17 | _delegate();
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Controls/StretchToolStripTextBox.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Drawing;
7 | using System.Windows.Forms;
8 | using System;
9 |
10 | namespace TestCentric.Gui.Controls
11 | {
12 | ///
13 | /// This class is required to stretch a ToolStripTextBox control within a ToolStrip to fill the available space and to resize when the control resizes.
14 | /// The implementation is from the Microsoft Windows Forms documentation, but simplified to the current use case.
15 | /// "How to: Stretch a ToolStripTextBox to Fill the Remaining Width of a ToolStrip"
16 | /// https://learn.microsoft.com/en-us/dotnet/desktop/winforms/controls/stretch-a-toolstriptextbox-to-fill-the-remaining-width-of-a-toolstrip-wf?view=netframeworkdesktop-4.8
17 | ///
18 | internal class StretchToolStripTextBox : ToolStripTextBox
19 | {
20 | public override Size GetPreferredSize(Size constrainingSize)
21 | {
22 | // Get width of the owning ToolStrip
23 | int textBoxMargin = 2;
24 | Int32 width = Owner.DisplayRectangle.Width - textBoxMargin;
25 |
26 | // If the available width is less than the default width, use the default width
27 | if (width < DefaultSize.Width) width = DefaultSize.Width;
28 |
29 | // Retrieve the preferred size from the base class, but change the width to the calculated width.
30 | Size size = base.GetPreferredSize(constrainingSize);
31 | size.Width = width;
32 | return size;
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Dialogs/ParameterDialog.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System;
7 | using System.Windows.Forms;
8 |
9 | namespace TestCentric.Gui.Dialogs
10 | {
11 | public partial class ParameterDialog : Form
12 | {
13 | public ParameterDialog()
14 | {
15 | InitializeComponent();
16 | }
17 |
18 | public ParameterDialog(string name, string value)
19 | {
20 | InitializeComponent();
21 |
22 | ParameterName = name;
23 | ParameterValue = value;
24 | }
25 |
26 | public string ParameterName
27 | {
28 | get { return parameterNameTextBox.Text; }
29 | set { parameterNameTextBox.Text = value; }
30 | }
31 |
32 | public string ParameterValue
33 | {
34 | get { return parameterValueTextBox.Text; }
35 | set { parameterValueTextBox.Text = value; }
36 | }
37 |
38 | private void parameterNameTextBox_TextChanged(object sender, EventArgs e)
39 | {
40 | EnableDisableOKButton();
41 | }
42 |
43 | private void parameterValueTextBox_TextChanged(object sender, EventArgs e)
44 | {
45 | EnableDisableOKButton();
46 | }
47 |
48 | private void EnableDisableOKButton()
49 | {
50 | okButton.Enabled = ParameterName.Length > 0 && ParameterValue.Length > 0;
51 | }
52 |
53 | private void okButton_Click(object sender, EventArgs e)
54 | {
55 | DialogResult = DialogResult.OK;
56 | Close();
57 | }
58 |
59 | private void cancelButton_Click(object sender, EventArgs e)
60 | {
61 | DialogResult = DialogResult.Cancel;
62 | Close();
63 | }
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Dialogs/SettingsDialog.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | namespace TestCentric.Gui.Dialogs
7 | {
8 | using Model;
9 | using Presenters;
10 | using SettingsPages;
11 |
12 | ///
13 | /// Static class used to display the tree-based SettingsDialog.
14 | ///
15 | public static class SettingsDialog
16 | {
17 | public static void Display(TestCentricPresenter presenter, ITestModel model)
18 | {
19 | TreeBasedSettingsDialog.Display(presenter, model,
20 | new GuiSettingsPage("General"),
21 | new TreeSettingsPage("Tree Display", presenter.ImageSetManager),
22 | new AdvancedLoaderSettingsPage("Assembly Load Settings"),
23 | new AssemblyReloadSettingsPage("Automatic Reload"),
24 | new ProjectEditorSettingsPage("Project Editor"));
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Elements/ControlElements/ButtonElement.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System;
7 | using System.Windows.Forms;
8 |
9 | namespace TestCentric.Gui.Elements
10 | {
11 | ///
12 | /// ButtonElement wraps a Button as an ICommand.
13 | ///
14 | [Obsolete("No longer used", true)]
15 | public class ButtonElement : ControlElement, ICommand
16 | {
17 | private Button _button;
18 |
19 | public event CommandHandler Execute;
20 | //public event CommandHandler CheckedChanged;
21 |
22 | //public bool Checked
23 | //{
24 | // get { return _button.Checked; }
25 | // set { InvokeIfRequired(() => _button.Checked = value); }
26 | //}
27 |
28 | public ButtonElement(Button button) : base(button)
29 | {
30 | _button = button;
31 |
32 | button.Click += (s, e) => Execute?.Invoke();
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Elements/ControlElements/CheckBoxElement.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Windows.Forms;
7 |
8 | namespace TestCentric.Gui.Elements
9 | {
10 | ///
11 | /// CheckBoxElement wraps a CheckBox as an IChecked.
12 | ///
13 | public class CheckBoxElement : ControlElement, IChecked
14 | {
15 | private CheckBox _checkBox;
16 |
17 | public CheckBoxElement(CheckBox checkBox) : base(checkBox)
18 | {
19 | _checkBox = checkBox;
20 | checkBox.CheckedChanged += (s, e) => CheckedChanged?.Invoke();
21 | }
22 |
23 | public bool Checked
24 | {
25 | get { return _checkBox.Checked; }
26 | set
27 | {
28 | if (_checkBox.Checked != value)
29 | InvokeIfRequired(() => _checkBox.Checked = value);
30 | }
31 | }
32 |
33 | public event CommandHandler CheckedChanged;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Elements/ControlElements/KeyCommand.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Windows.Forms;
9 |
10 | namespace TestCentric.Gui.Elements
11 | {
12 | ///
13 | /// This class is responsible to handle key events of a control
14 | ///
15 | internal class KeyCommand : IKeyCommand
16 | {
17 |
18 | public event CommandHandler KeyUp;
19 | public event CommandHandler KeyDown;
20 |
21 | private IEnumerable _upKeys;
22 | private IEnumerable _downKeys;
23 |
24 | public KeyCommand(Control control, IEnumerable upkeys, IEnumerable downkeys)
25 | {
26 | _upKeys = upkeys ?? new List();
27 | _downKeys = downkeys ?? new List();
28 |
29 | control.KeyUp += OnKeyUp;
30 | control.KeyUp += OnKeyDown;
31 | }
32 |
33 | private void OnKeyUp(object sender, KeyEventArgs e)
34 | {
35 | if (_upKeys.Contains(e.KeyCode))
36 | KeyUp?.Invoke();
37 | }
38 |
39 | private void OnKeyDown(object sender, KeyEventArgs e)
40 | {
41 | if (_downKeys.Contains(e.KeyCode))
42 | KeyDown?.Invoke();
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Elements/ControlElements/ListBoxElement.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System;
7 | using System.Windows.Forms;
8 |
9 | namespace TestCentric.Gui.Elements
10 | {
11 | ///
12 | /// ListBoxElement wraps a ListBox that contains string items
13 | /// or items that implement ToString() in a useful way.
14 | ///
15 | [Obsolete("No longer used", true)]
16 | public class ListBoxElement : ControlElement, IListBox
17 | {
18 | private ListBox _listBox;
19 |
20 | public ListBoxElement(ListBox listBox) : base(listBox)
21 | {
22 | _listBox = listBox;
23 | listBox.DoubleClick += (s, e) => DoubleClick?.Invoke();
24 | }
25 |
26 | #region IListBox Implementation
27 |
28 | public ListBox.ObjectCollection Items => _listBox.Items;
29 |
30 | public ListBox.SelectedObjectCollection SelectedItems => _listBox.SelectedItems;
31 |
32 | public event CommandHandler DoubleClick;
33 |
34 | public void Add(string item)
35 | {
36 | InvokeIfRequired(() => _listBox.Items.Add(item));
37 | }
38 |
39 | public void Remove(string item)
40 | {
41 | InvokeIfRequired(() => _listBox.Items.Remove(item));
42 | }
43 |
44 | #endregion
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Elements/ControlElements/TabSelector.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Windows.Forms;
7 |
8 | namespace TestCentric.Gui.Elements
9 | {
10 | ///
11 | /// A TabSelector represents which tab of a particular TabControl in
12 | /// the view is selected.
13 | ///
14 | public class TabSelector : ControlElement, ISelection
15 | {
16 | public event CommandHandler SelectionChanged;
17 |
18 | private TabControl _tabControl;
19 |
20 | public TabSelector(TabControl tabControl) : base(tabControl)
21 | {
22 | _tabControl = tabControl;
23 |
24 | tabControl.SelectedIndexChanged += (s, e) =>
25 | {
26 | int index = tabControl.SelectedIndex;
27 | if (index >= 0 && index < tabControl.TabCount)
28 | SelectionChanged?.Invoke();
29 | };
30 | }
31 |
32 | public int SelectedIndex
33 | {
34 | get { return _tabControl.SelectedIndex; }
35 | set { _tabControl.SelectedIndex = value; }
36 | }
37 |
38 | public string SelectedItem
39 | {
40 | get { return _tabControl.SelectedTab.Text; }
41 | set
42 | {
43 | foreach (TabPage tab in _tabControl.TabPages)
44 | if (tab.Text == value)
45 | _tabControl.SelectedTab = tab;
46 | }
47 | }
48 |
49 | public void Refresh()
50 | {
51 | _tabControl.Refresh();
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Elements/ICategoryFilterSelection.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using TestCentric.Gui.Model;
7 |
8 | namespace TestCentric.Gui.Elements
9 | {
10 | ///
11 | /// This interface is specialized for the selection of multiple test categories
12 | ///
13 | public interface ICategoryFilterSelection : IMultiSelection
14 | {
15 | ///
16 | /// Init the filter selection
17 | ///
18 | void Init(ITestModel testModel);
19 |
20 | ///
21 | /// Close the filter selection dialog
22 | ///
23 | void Close();
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Elements/IChanged.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | namespace TestCentric.Gui.Elements
7 | {
8 | ///
9 | /// The IChanged interface represents a IViewElement.
10 | /// If the IViewElement changes, it will raise the Changed event.
11 | ///
12 | public interface IChanged : IViewElement
13 | {
14 | ///
15 | /// Event raised when the element is changed by the user
16 | ///
17 | event CommandHandler Changed;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Elements/IChecked.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | namespace TestCentric.Gui.Elements
7 | {
8 | ///
9 | /// The IChecked interface is implemented by either a CheckBox
10 | /// or a MenuItem, which supports being checked or unchecked.
11 | ///
12 | public interface IChecked : IViewElement
13 | {
14 | bool Checked { get; set; }
15 |
16 | event CommandHandler CheckedChanged;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Elements/ICommand.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | namespace TestCentric.Gui.Elements
7 | {
8 | ///
9 | /// CommandHandler is used to request an action
10 | ///
11 | public delegate void CommandHandler();
12 |
13 | ///
14 | /// The ICommand interface represents any GUI item, which
15 | /// executes a command, e.g. a button or a menu item.
16 | ///
17 | public interface ICommand : IViewElement
18 | {
19 | ///
20 | /// Execute event is raised to signal the presenter
21 | /// to execute the associated command.
22 | ///
23 | event CommandHandler Execute;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Elements/IControlElement.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Drawing;
7 | using System.Windows.Forms;
8 |
9 | namespace TestCentric.Gui.Elements
10 | {
11 | ///
12 | /// IControlElement is implemented by elements that wrap controls.
13 | ///
14 | public interface IControlElement : IViewElement
15 | {
16 | Point Location { get; set; }
17 | Size Size { get; set; }
18 | Size ClientSize { get; set; }
19 |
20 | ContextMenu ContextMenu { get; }
21 | ContextMenuStrip ContextMenuStrip { get; }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Elements/IKeyCommand.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | namespace TestCentric.Gui.Elements
7 | {
8 | ///
9 | /// Interface to handle keyboard commands
10 | ///
11 | public interface IKeyCommand
12 | {
13 | ///
14 | /// Triggered on key up event
15 | ///
16 | event CommandHandler KeyUp;
17 |
18 | ///
19 | /// Triggered on key down event
20 | ///
21 | event CommandHandler KeyDown;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Elements/IListBox.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System;
7 | using System.Windows.Forms;
8 |
9 | namespace TestCentric.Gui.Elements
10 | {
11 | ///
12 | /// The IListBox interface is implemented by an element
13 | /// representing a ListBox containing string items or
14 | /// items that implement ToString() in a useful way.
15 | ///
16 | [Obsolete("No longer used", true)]
17 | public interface IListBox : IControlElement
18 | {
19 | ListBox.ObjectCollection Items { get; }
20 | ListBox.SelectedObjectCollection SelectedItems { get; }
21 |
22 | event CommandHandler DoubleClick;
23 |
24 | void Add(string item);
25 | void Remove(string item);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Elements/IMultiSelection.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Collections.Generic;
7 |
8 | namespace TestCentric.Gui.Elements
9 | {
10 | ///
11 | /// The IMultiSelection interface represents a group of UI elements
12 | /// that allow the user to select a set of items.
13 | ///
14 | public interface IMultiSelection : IViewElement
15 | {
16 | ///
17 | /// Gets or sets the string values of the currently selected items
18 | ///
19 | IEnumerable SelectedItems { get; set; }
20 |
21 | ///
22 | /// Event raised when the selection is changed by the user
23 | ///
24 | event CommandHandler SelectionChanged;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Elements/IPopup.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | namespace TestCentric.Gui.Elements
7 | {
8 | ///
9 | /// The IPopup interface represents a menu item, which
10 | /// displays a list of sub-items when clicked.
11 | ///
12 | public interface IPopup : IToolStripMenu
13 | {
14 | /// Popup event is raised to signal the presenter
15 | /// that the menu items under this element are
16 | /// about to be displayed.
17 | ///
18 | event CommandHandler Popup;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Elements/ISelection.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | namespace TestCentric.Gui.Elements
7 | {
8 | ///
9 | /// The ISelection interface represents a single UI element
10 | /// or a group of elements that allow the user to select one
11 | /// of a set of items.
12 | ///
13 | public interface ISelection : IViewElement
14 | {
15 | ///
16 | /// Gets or sets the index of the currently selected item
17 | ///
18 | int SelectedIndex { get; set; }
19 |
20 | ///
21 | /// Gets or sets the string value of the currently selected item
22 | ///
23 | string SelectedItem { get; set; }
24 |
25 | ///
26 | /// Refresh selection if possible, otherwise noop
27 | ///
28 | void Refresh();
29 |
30 | ///
31 | /// Event raised when the selection is changed by the user
32 | ///
33 | event CommandHandler SelectionChanged;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Elements/IToolStripMenu.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Windows.Forms;
7 |
8 | namespace TestCentric.Gui.Elements
9 | {
10 | ///
11 | /// IMenu is implemented by a menu item that displays subitems.
12 | ///
13 | public interface IToolStripMenu : IViewElement
14 | {
15 | ToolStripItemCollection MenuItems { get; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Elements/IToolTip.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | namespace TestCentric.Gui.Elements
7 | {
8 | ///
9 | /// IToolTip is implemented by elements, which are able to
10 | /// get and set their own tool tip text. It is a single-
11 | /// capability interface and is generally used in conjunction
12 | /// with IViewElement or a derived interface.
13 | ///
14 | public interface IToolTip
15 | {
16 | string ToolTipText { get; set; }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Elements/IViewElement.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Windows.Forms;
7 |
8 | namespace TestCentric.Gui.Elements
9 | {
10 | ///
11 | /// The IViewElement interface wraps an individual gui
12 | /// item like a control or toolstrip item. It is generally
13 | /// exposed by views and is the base of other interfaces
14 | /// in the TestCentric.Gui.Elements namespace.
15 | ///
16 | public interface IViewElement
17 | {
18 | ///
19 | /// Gets or sets the Enabled status of the element
20 | ///
21 | bool Enabled { get; set; }
22 |
23 | ///
24 | /// Gets or sets the Visible status of the element
25 | ///
26 | bool Visible { get; set; }
27 |
28 | ///
29 | /// Gets or sets the text of an element.
30 | ///
31 | string Text { get; set; }
32 |
33 | ///
34 | /// Invoke a delegate if necessary, otherwise just call it
35 | ///
36 | void InvokeIfRequired(MethodInvoker _delegate);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Elements/ToolStripElements/CheckedMenuElement.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Windows.Forms;
7 |
8 | namespace TestCentric.Gui.Elements
9 | {
10 | ///
11 | /// Implements a MenuElement, which may be checked or unchecked.
12 | ///
13 | public class CheckedMenuElement : ToolStripMenuElement, IChecked
14 | {
15 | public event CommandHandler CheckedChanged;
16 |
17 | public CheckedMenuElement(ToolStripMenuItem menuItem)
18 | : base(menuItem)
19 | {
20 | menuItem.CheckOnClick = true;
21 | menuItem.CheckedChanged += (s, e) => CheckedChanged?.Invoke();
22 | }
23 |
24 | public bool Checked
25 | {
26 | get { return _menuItem.Checked; }
27 | set
28 | {
29 | if (_menuItem.Checked != value)
30 | {
31 | InvokeIfRequired(() =>
32 | {
33 | _menuItem.Checked = value;
34 | });
35 | }
36 | }
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Elements/ToolStripElements/CommandMenuElement.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Windows.Forms;
7 |
8 | namespace TestCentric.Gui.Elements
9 | {
10 | ///
11 | /// CommandMenuElement represents a menu item, which
12 | /// invokes a command when clicked.
13 | ///
14 | public class CommandMenuElement : ToolStripMenuElement, ICommand
15 | {
16 | public event CommandHandler Execute;
17 |
18 | public CommandMenuElement(ToolStripMenuItem menuItem)
19 | : base(menuItem)
20 | {
21 | menuItem.Click += (s, e) => Execute?.Invoke();
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Elements/ToolStripElements/PopupMenuElement.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System;
7 | using System.Collections.Generic;
8 | using System.Windows.Forms;
9 |
10 | namespace TestCentric.Gui.Elements
11 | {
12 | ///
13 | /// PopupMenuElement represents a menu item with subitems,
14 | /// which may need to be populated when they are about to
15 | /// to be displayed.
16 | ///
17 | public class PopupMenuElement : ToolStripMenuElement, IPopup
18 | {
19 | public event CommandHandler Popup;
20 |
21 | public PopupMenuElement(ToolStripMenuItem menuItem)
22 | : base(menuItem)
23 | {
24 | menuItem.DropDownOpening += (s, e) => Popup?.Invoke();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Elements/ToolStripElements/SplitButtonElement.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System;
7 | using System.Windows.Forms;
8 |
9 | namespace TestCentric.Gui.Elements
10 | {
11 | ///
12 | /// SplitButtonElement extends ToolStripElement for use with a SplitButton.
13 | ///
14 | [Obsolete("No longer used", true)]
15 | public class SplitButtonElement : ToolStripElement, ICommand
16 | {
17 | public SplitButtonElement(ToolStripSplitButton button) : base(button)
18 | {
19 | button.ButtonClick += delegate { if (Execute != null) Execute(); };
20 | }
21 |
22 | public event CommandHandler Execute;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Elements/ToolStripElements/ToolStripButtonElement.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Windows.Forms;
7 |
8 | namespace TestCentric.Gui.Elements
9 | {
10 | ///
11 | /// ToolStripButtonElement wraps a Windows ToolStripButton.
12 | ///
13 | public class ToolStripButtonElement : ToolStripElement, ICommand, IChecked
14 | {
15 | private ToolStripButton _button;
16 |
17 | public event CommandHandler Execute;
18 | public event CommandHandler CheckedChanged;
19 |
20 | public bool Checked
21 | {
22 | get { return _button.Checked; }
23 | set { InvokeIfRequired(() => _button.Checked = value); }
24 | }
25 |
26 | public ToolStripButtonElement(ToolStripButton button) : base(button)
27 | {
28 | _button = button;
29 |
30 | button.Click += (s, e) => Execute?.Invoke();
31 | button.CheckedChanged += (s, e) => CheckedChanged.Invoke();
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Elements/ToolStripElements/ToolStripElement.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Windows.Forms;
7 |
8 | namespace TestCentric.Gui.Elements
9 | {
10 | ///
11 | /// ToolStripItem is a generic wrapper for ToolStripItems
12 | ///
13 | public class ToolStripElement : IViewElement, IToolTip
14 | {
15 | private ToolStripItem _toolStripItem;
16 |
17 | public ToolStripElement(ToolStripItem toolStripItem)
18 | {
19 | _toolStripItem = toolStripItem;
20 | }
21 |
22 | public bool Enabled
23 | {
24 | get { return _toolStripItem.Enabled; }
25 | set { InvokeIfRequired(() => { _toolStripItem.Enabled = value; }); }
26 | }
27 |
28 | public bool Visible
29 | {
30 | get { return _toolStripItem.Visible; }
31 | set { InvokeIfRequired(() => { _toolStripItem.Visible = value; }); }
32 | }
33 |
34 | public string Text
35 | {
36 | get { return _toolStripItem.Text; }
37 | set { InvokeIfRequired(() => { _toolStripItem.Text = value; }); }
38 | }
39 |
40 | public string ToolTipText
41 | {
42 | get { return _toolStripItem.ToolTipText; }
43 | set { InvokeIfRequired(() => { _toolStripItem.ToolTipText = value; }); }
44 | }
45 |
46 | public void InvokeIfRequired(MethodInvoker del)
47 | {
48 | var toolStrip = _toolStripItem.GetCurrentParent();
49 |
50 | if (toolStrip != null && toolStrip.InvokeRequired)
51 | toolStrip.BeginInvoke(del, new object[0]);
52 | else
53 | del();
54 | }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Elements/ToolStripElements/ToolStripMenuElement.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System;
7 | using System.Collections.Generic;
8 | using System.Windows.Forms;
9 |
10 | namespace TestCentric.Gui.Elements
11 | {
12 | ///
13 | /// ToolStripMenuElement is the abstract base for all our menu
14 | /// elements. It wraps a single ToolStripMenuItem. Use the appropriate
15 | /// derived class depending on whether the element is a popup
16 | /// menu, a checked menu item or simply invokes a command.
17 | ///
18 | public abstract class ToolStripMenuElement : ToolStripElement
19 | {
20 | protected ToolStripMenuItem _menuItem;
21 |
22 | public ToolStripMenuElement(ToolStripMenuItem menuItem)
23 | : base(menuItem)
24 | {
25 | _menuItem = menuItem;
26 | }
27 |
28 | public ToolStripMenuElement(string text) : this(new ToolStripMenuItem(text)) { }
29 |
30 | public ToolStripItemCollection MenuItems
31 | {
32 | get { return _menuItem.DropDown.Items; }
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/IDialogManager.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Collections.Generic;
7 | using System.Drawing;
8 |
9 | namespace TestCentric.Gui.Views
10 | {
11 | public delegate void ApplyFontHandler(Font font);
12 |
13 | public interface IDialogManager
14 | {
15 | IList SelectMultipleFiles(string title, string filter);
16 |
17 | string GetFileOpenPath(string title, string filter);
18 |
19 | string GetFileSavePath(string title, string filter, string initialDirectory, string suggestedName);
20 |
21 | string GetFolderPath(string message, string initialPath);
22 |
23 | Font SelectFont(Font currentFont);
24 |
25 | event ApplyFontHandler ApplyFont;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/ILongRunningOperationDisplay.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | namespace TestCentric.Gui
7 | {
8 | public interface ILongRunningOperationDisplay
9 | {
10 | void Display(string text);
11 | void Hide();
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/IMessageDisplay.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System;
7 |
8 | namespace TestCentric.Gui
9 | {
10 | ///
11 | /// Interface implemented by objects, which know how to display a message
12 | ///
13 | public interface IMessageDisplay
14 | {
15 | void Error(string message);
16 |
17 | void Info(string message);
18 |
19 | bool YesNo(string message);
20 |
21 | MessageBoxResult YesNoCancel(string message);
22 |
23 | bool OkCancel(string message);
24 | }
25 |
26 | ///
27 | /// Enum representing the return value of a MessageBox
28 | /// It contains the identical values in same order as the DialogResult enum from Windows Forms
29 | /// It has the same intention as the interface to hide any implementation details to the caller.
30 | ///
31 | public enum MessageBoxResult
32 | {
33 | None,
34 | OK,
35 | Cancel,
36 | Abort,
37 | Retry,
38 | Ignore,
39 | Yes,
40 | No,
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/DebugTests.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/DebugTests.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/Ellipsis.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/Ellipsis.gif
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/GroupBy_16x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/GroupBy_16x.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/ResetFilter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/ResetFilter.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/RunAllTests.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/RunAllTests.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/RunTests.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/RunTests.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/StopRun.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/StopRun.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/Stopwatch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/Stopwatch.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/SummaryReport.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/SummaryReport.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/TestFilter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/TestFilter.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/Tree/Circles/Failure.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/Tree/Circles/Failure.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/Tree/Circles/Ignored.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/Tree/Circles/Ignored.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/Tree/Circles/Inconclusive.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/Tree/Circles/Inconclusive.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/Tree/Circles/Running.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/Tree/Circles/Running.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/Tree/Circles/Skipped.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/Tree/Circles/Skipped.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/Tree/Circles/Success.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/Tree/Circles/Success.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/Tree/Circles/Warning.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/Tree/Circles/Warning.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/Tree/Classic/Failure.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/Tree/Classic/Failure.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/Tree/Classic/Ignored.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/Tree/Classic/Ignored.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/Tree/Classic/Inconclusive.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/Tree/Classic/Inconclusive.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/Tree/Classic/Running.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/Tree/Classic/Running.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/Tree/Classic/Skipped.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/Tree/Classic/Skipped.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/Tree/Classic/Success.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/Tree/Classic/Success.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/Tree/Classic/Warning.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/Tree/Classic/Warning.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/Tree/Visual Studio/Failure.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/Tree/Visual Studio/Failure.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/Tree/Visual Studio/Ignored.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/Tree/Visual Studio/Ignored.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/Tree/Visual Studio/Inconclusive.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/Tree/Visual Studio/Inconclusive.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/Tree/Visual Studio/Running.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/Tree/Visual Studio/Running.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/Tree/Visual Studio/Skipped.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/Tree/Visual Studio/Skipped.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/Tree/Visual Studio/Success.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/Tree/Visual Studio/Success.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/Tree/Visual Studio/Warning.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/Tree/Visual Studio/Warning.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/blank-stop-sign-256x256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/blank-stop-sign-256x256.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/exit-button.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/exit-button.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/force-stop-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/force-stop-icon.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/forced-stop-256x256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/forced-stop-256x256.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/pinned.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/pinned.gif
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/stop-sign-500x500.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/stop-sign-500x500.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/testcentric_128x128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/testcentric_128x128.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/testcentric_256x256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/testcentric_256x256.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/testcentric_32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/testcentric_32x32.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/testcentric_64x64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/testcentric_64x64.png
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Images/unpinned.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Images/unpinned.gif
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/MessageBuilder.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System;
7 | using System.Text;
8 |
9 | namespace TestCentric.Gui
10 | {
11 | ///
12 | /// Static methods for creating messages
13 | ///
14 | public static class MessageBuilder
15 | {
16 | ///
17 | /// Build a message including all info about an exception
18 | ///
19 | /// The exception
20 | /// A string containing the message
21 | public static string FromException(Exception exception)
22 | {
23 | Exception ex = exception;
24 | StringBuilder sb = new StringBuilder();
25 |
26 | sb.AppendFormat("{0} : {1}", ex.GetType().ToString(), ex.Message);
27 |
28 | while (ex.InnerException != null)
29 | {
30 | ex = ex.InnerException;
31 | sb.AppendFormat("\r----> {0} : {1}", ex.GetType().ToString(), ex.Message);
32 | }
33 |
34 | return sb.ToString();
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/OutcomeImageSet.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System;
7 | using System.Collections.Generic;
8 | using System.Drawing;
9 | using System.IO;
10 | using System.Linq;
11 | using System.Text;
12 | using System.Threading.Tasks;
13 | using TestCentric.Engine;
14 |
15 | namespace TestCentric.Gui
16 | {
17 | public class OutcomeImageSet
18 | {
19 | private static readonly string[] REQUIRED_FILES = new[] {
20 | "Inconclusive.png", "Success.png", "Failure.png", "Ignored.png", "Skipped.png" };
21 |
22 | private string _imageSetDir;
23 |
24 | public OutcomeImageSet(string imageSetDir)
25 | {
26 | Guard.ArgumentValid(IsValidImageSetDirectory(imageSetDir), $"Directory {imageSetDir} does not contain an image set.", nameof(imageSetDir));
27 |
28 | _imageSetDir = imageSetDir;
29 |
30 | Name = Path.GetFileName(imageSetDir);
31 | }
32 |
33 | public string Name { get; }
34 |
35 | public static bool IsValidImageSetDirectory(string dir)
36 | {
37 | foreach (string file in REQUIRED_FILES)
38 | if (!File.Exists(Path.Combine(dir, file)))
39 | return false;
40 |
41 | return true;
42 | }
43 |
44 | // Counter used for testing
45 | public int LoadCount { get; private set; } = 0;
46 |
47 | private Dictionary _images = new Dictionary();
48 |
49 | public Image LoadImage(string imgName)
50 | {
51 | if (_images.ContainsKey(imgName))
52 | return _images[imgName];
53 |
54 | LoadCount++;
55 |
56 | return _images[imgName] = Image.FromFile(Path.Combine(_imageSetDir, imgName + ".png"));
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Presenters/ITreeDisplayStrategyFactory.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using TestCentric.Gui.Model;
7 | using TestCentric.Gui.Views;
8 |
9 | namespace TestCentric.Gui.Presenters
10 | {
11 | ///
12 | /// This factory interface supports the creation of TreeDisplayStrategy classes
13 | ///
14 | public interface ITreeDisplayStrategyFactory
15 | {
16 | ///
17 | /// Creates a concrete class implementing interface ITreeDisplayStrategy
18 | /// Supported displayStrategy:
19 | /// - "NUNIT_TREE" (also default case)
20 | /// - "FIXTURE_LIST"
21 | /// - "TEST_LIST"
22 | ///
23 | ITreeDisplayStrategy Create(string displayStrategy, ITestTreeView treeView, ITestModel testModel);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Presenters/InitialTreeExpansion.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | namespace TestCentric.Gui.Presenters
7 | {
8 | ///
9 | /// Indicates how a tree should be displayed
10 | ///
11 | public enum InitialTreeExpansion
12 | {
13 | Auto, // Select based on space available
14 | Expand, // Expand fully
15 | Collapse, // Collapse fully
16 | HideTests // Expand all but the fixtures, leaving
17 | // leaf nodes hidden
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Presenters/NUnitGrouping/CategoryGrouping.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Xml;
9 | using TestCentric.Gui.Model;
10 | using TestCentric.Gui.Views;
11 |
12 | namespace TestCentric.Gui.Presenters.NUnitGrouping
13 | {
14 | public class CategoryGrouping : GroupingBase
15 | {
16 | public CategoryGrouping(INUnitTreeDisplayStrategy support, ITestModel model, ITestTreeView view) :
17 | base(support, model, view)
18 | {
19 | }
20 |
21 | public override IList GetGroupNames(TestNode testNode)
22 | {
23 | return GetAllCategories(testNode);
24 | }
25 |
26 |
27 | private List GetAllCategories(TestNode testNode)
28 | {
29 | string xpathExpression = "ancestor-or-self::*/properties/property[@name='Category']";
30 |
31 | // Get list of available categories of the TestNode
32 | List categories = new List();
33 | foreach (XmlNode node in testNode.Xml.SelectNodes(xpathExpression))
34 | {
35 | var groupName = node.Attributes["value"].Value;
36 | if (!string.IsNullOrEmpty(groupName))
37 | categories.Add(groupName);
38 | }
39 |
40 | if (categories.Any() == false)
41 | categories.Add("None");
42 |
43 | return categories;
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Presenters/NUnitGrouping/DurationGrouping.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Collections.Generic;
7 | using TestCentric.Gui.Model;
8 | using TestCentric.Gui.Views;
9 |
10 | namespace TestCentric.Gui.Presenters.NUnitGrouping
11 | {
12 | public class DurationGrouping : GroupingBase
13 | {
14 | public DurationGrouping(INUnitTreeDisplayStrategy support, ITestModel model, ITestTreeView view) :
15 | base(support, model, view)
16 | {
17 | SupportsRegrouping = true;
18 | }
19 |
20 | public override IList GetGroupNames(TestNode testNode)
21 | {
22 | string outcome = GetDuration(testNode);
23 | return new List { outcome };
24 | }
25 |
26 | private string GetDuration(TestNode child)
27 | {
28 | var result = Model.GetResultForTest(child.Id);
29 | if (result == null)
30 | return "Not run";
31 |
32 | if (result.Duration < 0.1)
33 | {
34 | return "Fast";
35 | }
36 | else if (result.Duration < 0.5)
37 | return "Medium";
38 |
39 | return "Slow";
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Presenters/NUnitGrouping/INUnitGrouping.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Collections.Generic;
7 | using System.Windows.Forms;
8 | using TestCentric.Gui.Model;
9 |
10 | namespace TestCentric.Gui.Presenters.NUnitGrouping
11 | {
12 | public interface INUnitGrouping
13 | {
14 | ///
15 | /// Creates the complete grouped tree
16 | ///
17 | void CreateTree(TestNode node);
18 |
19 | ///
20 | /// Retrieves the list of groups in which a testNode is grouped
21 | ///
22 | IList GetGroupNames(TestNode testNode);
23 |
24 | ///
25 | /// Creates (or reuse) all tree nodes along the path from the group to the testNode (representing a test case)
26 | /// Returns the path of tree nodes from the root tree node (group) to the leaf tree node (test case)
27 | ///
28 | IList CreateTreeNodes(TestNode testNode, string groupName);
29 |
30 | ///
31 | /// Called when one test case is finished
32 | ///
33 | void OnTestFinished(ResultNode result);
34 |
35 | ///
36 | /// Called when the entire test run is finished
37 | ///
38 | void OnTestRunFinished();
39 |
40 | ///
41 | /// Called when the entire test run is starting
42 | ///
43 | void OnTestRunStarting();
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Presenters/NUnitGrouping/INUnitTreeDisplayStrategy.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Collections.Generic;
7 | using System.Windows.Forms;
8 | using TestCentric.Gui.Model;
9 |
10 | namespace TestCentric.Gui.Presenters.NUnitGrouping
11 | {
12 | public interface INUnitTreeDisplayStrategy
13 | {
14 | ///
15 | /// Creates a new tree node for a TestNode
16 | ///
17 | TreeNode MakeTreeNode(TestNode testNode);
18 |
19 | ///
20 | /// Creates a new tree node for a TestGroup which is associated to a TestNode
21 | ///
22 | TreeNode MakeTreeNode(TestGroup testGroup, TestNode testNode);
23 |
24 | ///
25 | /// Removes one tree node from the tree
26 | ///
27 | void RemoveTreeNode(TreeNode treeNode);
28 |
29 | ///
30 | /// Check if a tree node type should be shown or omitted
31 | /// Currently we support only omitting the namespace nodes
32 | ///
33 | bool ShowTreeNodeType(TestNode testNode);
34 |
35 | ///
36 | /// Get the associated tree nodes for one test node
37 | /// In common there'll be only one single tree node, only for category grouping multiple tree nodes might exists
38 | ///
39 | List GetTreeNodesForTest(TestNode testNode);
40 |
41 | void UpdateTreeNodeNames();
42 |
43 | void UpdateTreeNodeNames(IEnumerable treeNodes);
44 |
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Presenters/NUnitGrouping/OutcomeGrouping.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Collections.Generic;
7 | using TestCentric.Gui.Model;
8 | using TestCentric.Gui.Views;
9 |
10 | namespace TestCentric.Gui.Presenters.NUnitGrouping
11 | {
12 | public class OutcomeGrouping : GroupingBase
13 | {
14 | public OutcomeGrouping(INUnitTreeDisplayStrategy support, ITestModel model, ITestTreeView view) :
15 | base(support, model, view)
16 | {
17 | SupportsRegrouping = true;
18 | }
19 |
20 | public override IList GetGroupNames(TestNode testNode)
21 | {
22 | string outcome = GetOutcome(testNode);
23 | return new List { outcome };
24 | }
25 |
26 | private string GetOutcome(TestNode child)
27 | {
28 | var result = Model.GetResultForTest(child.Id);
29 | if (result == null)
30 | return "Not run";
31 |
32 | if (result.Outcome.Equals(ResultState.Ignored))
33 | return "Ignored";
34 |
35 | return result.Outcome.ToString();
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Presenters/NUnitGrouping/TreeNodeImageHandler.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Windows.Forms;
7 | using System;
8 | using TestCentric.Gui.Views;
9 | using System.Collections.Generic;
10 |
11 | namespace TestCentric.Gui.Presenters.NUnitGrouping
12 | {
13 | ///
14 | /// Helper class to determine the image of a tree node
15 | ///
16 | public class TreeNodeImageHandler
17 | {
18 | public static void SetTreeNodeImages(ITestTreeView treeView, IEnumerable treeNodes, bool recursive)
19 | {
20 | foreach (TreeNode treeNode in treeNodes)
21 | {
22 | SetTreeNodeImage(treeView, treeNode, recursive);
23 | }
24 | }
25 |
26 | private static void SetTreeNodeImage(ITestTreeView treeView, TreeNode treeNode, bool recursive)
27 | {
28 | int imageIndex = TestTreeView.InitIndex;
29 | foreach (TreeNode childNode in treeNode.Nodes)
30 | {
31 | if (recursive && childNode.ImageIndex <= TestTreeView.InitIndex)
32 | SetTreeNodeImage(treeView, childNode, recursive);
33 |
34 | // Ignore index is set to a TreeNode when created => don't propagate up automatically on loading tree
35 | if (!recursive || childNode.ImageIndex != TestTreeView.IgnoredIndex)
36 | imageIndex = Math.Max(imageIndex, childNode.ImageIndex);
37 | }
38 |
39 | treeView.SetImageIndex(treeNode, imageIndex);
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Presenters/TestGroup.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Text;
7 | using System.Windows.Forms;
8 |
9 | namespace TestCentric.Gui.Presenters
10 | {
11 | using Model;
12 |
13 | ///
14 | /// A TestGroup is essentially a TestSelection with a
15 | /// name and image index for use in the tree display.
16 | /// Its TreeNode property is externally set and updated.
17 | /// It can create a filter for running all the tests
18 | /// in the group.
19 | ///
20 | public class TestGroup : TestSelection, ITestItem
21 | {
22 | #region Constructors
23 |
24 | public TestGroup(string name) : this(name, -1) { }
25 |
26 | public TestGroup(string name, int imageIndex)
27 | {
28 | Name = name;
29 | ImageIndex = imageIndex;
30 | }
31 |
32 | #endregion
33 |
34 | #region Properties
35 |
36 | public override string Name { get; }
37 |
38 | public int ImageIndex { get; set; }
39 |
40 | public double? Duration { get; set; }
41 |
42 | public TreeNode TreeNode { get; set; }
43 |
44 | #endregion
45 |
46 | public override TestFilter GetTestFilter()
47 | {
48 | StringBuilder sb = new StringBuilder("");
49 |
50 | foreach (TestNode test in this)
51 | if (test.RunState != RunState.Explicit)
52 | sb.AppendFormat("{0}", test.Id);
53 |
54 | sb.Append("");
55 |
56 | return new TestFilter(sb.ToString());
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Presenters/TreeDisplayStrategyFactory.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using TestCentric.Gui.Model;
7 | using TestCentric.Gui.Views;
8 |
9 | namespace TestCentric.Gui.Presenters
10 | {
11 | ///
12 | /// This factory class is responsible for the creation of TreeDisplayStrategy classes
13 | ///
14 | public class TreeDisplayStrategyFactory : ITreeDisplayStrategyFactory
15 | {
16 | public ITreeDisplayStrategy Create(string displayStrategy, ITestTreeView treeView, ITestModel testModel)
17 | {
18 | switch (displayStrategy)
19 | {
20 | case "FIXTURE_LIST":
21 | return new FixtureListDisplayStrategy(treeView, testModel);
22 | case "TEST_LIST":
23 | return new TestListDisplayStrategy(treeView, testModel);
24 | case "NUNIT_TREE":
25 | default:
26 | return new NUnitTreeDisplayStrategy(treeView, testModel);
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Resources/picturebox1.Image.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/TestCentric/testcentric.gui/Resources/picturebox1.Image.bmp
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/TestCentricFormBase.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System;
7 | using System.Windows.Forms;
8 |
9 | namespace TestCentric.Gui
10 | {
11 | public class TestCentricFormBase : Form
12 | {
13 | private IMessageDisplay messageDisplay;
14 | private string caption;
15 |
16 | public TestCentricFormBase() { }
17 |
18 | public TestCentricFormBase(string caption)
19 | {
20 | this.caption = caption;
21 | }
22 |
23 | public IMessageDisplay MessageDisplay
24 | {
25 | get
26 | {
27 | if (messageDisplay == null)
28 | messageDisplay = new MessageBoxDisplay(caption == null ? Text : caption);
29 |
30 | return messageDisplay;
31 | }
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Views/IErrorsAndFailuresView.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System;
7 | using System.Drawing;
8 | using System.Windows.Forms;
9 |
10 | namespace TestCentric.Gui.Views
11 | {
12 | public interface IErrorsAndFailuresView
13 | {
14 | event EventHandler SplitterPositionChanged;
15 | event EventHandler SourceCodeSplitterDistanceChanged;
16 | event EventHandler SourceCodeSplitOrientationChanged;
17 | event EventHandler SourceCodeDisplayChanged;
18 |
19 | string Header { get; set; }
20 |
21 | bool EnableToolTips { get; set; }
22 | int SplitterPosition { get; set; }
23 | float SourceCodeSplitterDistance { get; set; }
24 | Orientation SourceCodeSplitOrientation { get; set; }
25 | bool SourceCodeDisplay { get; set; }
26 |
27 | ITestResultSubView TestResultSubView { get; }
28 | ITestOutputSubView TestOutputSubView { get; }
29 |
30 | void Clear();
31 | void AddResult(string status, string testName, string message, string stackTrace);
32 | void SetFixedFont(Font font);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Views/ILongRunningOperation.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | namespace TestCentric.Gui
7 | {
8 | public interface ILongRunningOperation
9 | {
10 | void Display(string text);
11 | void Hide();
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Views/IProgressBarView.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | namespace TestCentric.Gui.Views
7 | {
8 | public enum ProgressBarStatus
9 | {
10 | Success = 0,
11 | Warning = 1,
12 | Failure = 2
13 | }
14 |
15 | public interface IProgressBarView
16 | {
17 | int Progress { get; set; }
18 | ProgressBarStatus Status { get; set; }
19 |
20 | void Initialize(int max);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Views/IStatusBarView.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | namespace TestCentric.Gui.Views
7 | {
8 | // Interface is used by presenter and tests
9 | public interface IStatusBarView
10 | {
11 | void Initialize();
12 |
13 | bool Visible { get; set; }
14 | string Text { get; set; }
15 | int Passed { set; }
16 | int Failed { set; }
17 | int Warnings { set; }
18 | int Inconclusive { set; }
19 | int Ignored { set; }
20 | int Skipped { set; }
21 | double Duration { set; }
22 |
23 | void LoadImages(OutcomeImageSet imageSet);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Views/ITestOutputSubView.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | namespace TestCentric.Gui.Views
7 | {
8 | public interface ITestOutputSubView
9 | {
10 | string Output { get; set; }
11 |
12 | void SetVisibility(bool visible);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Views/ITestPropertiesVIew.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | namespace TestCentric.Gui.Views
7 | {
8 | using System;
9 | using Elements;
10 |
11 | public interface ITestPropertiesView : IView
12 | {
13 | event EventHandler Resize;
14 | event CommandHandler DisplayHiddenPropertiesChanged;
15 |
16 | bool Visible { get; set; }
17 | int ClientHeight { get; }
18 |
19 | string Header { get; set; }
20 | string TestType { get; set; }
21 | string FullName { get; set; }
22 | string Description { get; set; }
23 | string Categories { get; set; }
24 | string TestCount { get; set; }
25 | string RunState { get; set; }
26 | string SkipReason { get; set; }
27 | bool DisplayHiddenProperties { get; }
28 | string Properties { get; set; }
29 | string PackageSettings { get; set; }
30 |
31 | TestPackageSubView TestPackageSubView { get; }
32 | TestPropertiesSubView TestPropertiesSubView { get; }
33 | TestPropertiesView.SubView[] SubViews { get; }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Views/ITestResultSubView.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using TestCentric.Gui.Model;
7 | using TestCentric.Gui.Presenters;
8 |
9 | namespace TestCentric.Gui.Views
10 | {
11 | public interface ITestResultSubView
12 | {
13 | ///
14 | /// Clear all content in the view
15 | ///
16 | void Clear();
17 |
18 | ///
19 | /// Load test outcome images 'Passed', 'Failed'...
20 | ///
21 | void LoadImages(OutcomeImageSet imageSet);
22 |
23 | ///
24 | /// View is separated in two section: Caption and detail section
25 | /// Caption section contain the overall outcome, duration and test + assertion count
26 | ///
27 | void UpdateCaption(TestResultCounts testCounts, ResultState resultState);
28 |
29 | ///
30 | /// View is separated in two section: Caption and detail section
31 | /// Detail section contain the number of passed, failed tests
32 | ///
33 | void UpdateDetailSection(TestResultCounts summary);
34 |
35 | ///
36 | /// Show/hide the detail section
37 | ///
38 | void UpdateDetailSectionVisibility(bool visible);
39 |
40 | ///
41 | /// Shrink the view to show only the caption section
42 | ///
43 | void ShrinkToCaption();
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Views/ITestsNotRunView.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | namespace TestCentric.Gui.Views
7 | {
8 | public interface ITestsNotRunView
9 | {
10 | void Clear();
11 |
12 | void AddResult(string name, string reason);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Views/ITextOutputView.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Drawing;
7 | using TestCentric.Gui.Elements;
8 |
9 | namespace TestCentric.Gui.Views
10 | {
11 | public interface ITextOutputView
12 | {
13 | bool WordWrap { get; set; }
14 | ISelection Labels { get; set; }
15 |
16 | void Clear();
17 | void Write(string text);
18 | void Write(string text, Color color);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Views/IView.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System;
7 |
8 | namespace TestCentric.Gui.Views
9 | {
10 | public interface IView
11 | {
12 | event EventHandler Load;
13 |
14 | void SuspendLayout();
15 | void ResumeLayout();
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Views/IXmlView.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Windows.Forms;
7 | using System.Xml;
8 |
9 | namespace TestCentric.Gui.Views
10 | {
11 | using Elements;
12 |
13 | public interface IXmlView : IView
14 | {
15 | bool Visible { get; set; }
16 | bool WordWrap { get; set; }
17 |
18 | string Header { get; set; }
19 | IViewElement XmlPanel { get; }
20 |
21 | ICommand CopyToolStripMenuItem { get; }
22 | IChecked WordWrapToolStripMenuItem { get; }
23 |
24 | XmlNode TestXml { get; set; }
25 |
26 | string SelectedText { get; set; }
27 |
28 | void SelectAll();
29 | void Copy();
30 |
31 | event CommandHandler SelectAllCommand;
32 | event CommandHandler SelectionChanged;
33 | event CommandHandler CopyCommand;
34 | event CommandHandler WordWrapChanged;
35 | event CommandHandler ViewGotFocus;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Views/TestOutputSubView.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | namespace TestCentric.Gui.Views
7 | {
8 | public partial class TestOutputSubView : TestPropertiesView.SubView, ITestOutputSubView
9 | {
10 | public TestOutputSubView()
11 | {
12 | InitializeComponent();
13 | }
14 |
15 | public override int FullHeight => output.Top + HeightNeededForControl(output) + 4;
16 |
17 | public string Output
18 | {
19 | get { return output.Text; }
20 | set { this.InvokeIfRequired(() => { output.Text = value; }); }
21 | }
22 |
23 | public void SetVisibility(bool visible)
24 | {
25 | InvokeIfRequired(() => { Visible = visible; });
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Views/TestPackageSubView.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Drawing;
7 | using System.Windows.Forms;
8 |
9 | namespace TestCentric.Gui.Views
10 | {
11 | public partial class TestPackageSubView : TestPropertiesView.SubView
12 | {
13 | public TestPackageSubView()
14 | {
15 | InitializeComponent();
16 | }
17 |
18 | public override int FullHeight => packageSettings.Top + HeightNeededForControl(packageSettings) + 8;
19 |
20 | public string PackageSettings
21 | {
22 | get { return packageSettings.Text; }
23 | set { InvokeIfRequired(() => { packageSettings.Text = value; }); }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/Views/UserControlView.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System;
7 | using System.Windows.Forms;
8 |
9 | namespace TestCentric.Gui.Views
10 | {
11 | ///
12 | /// Base class for views implemented as a user control
13 | ///
14 | public class UserControlView : UserControl
15 | {
16 | public void InvokeIfRequired(MethodInvoker _delegate)
17 | {
18 | if (InvokeRequired)
19 | BeginInvoke(_delegate);
20 | else
21 | _delegate();
22 | }
23 |
24 | public T InvokeIfRequired(Func func)
25 | {
26 | return InvokeRequired
27 | ? (T)Invoke(func)
28 | : (T)func();
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/TestCentric/testcentric.gui/WaitCursor.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System;
7 | using System.Windows.Forms;
8 |
9 | namespace TestCentric.Gui
10 | {
11 | ///
12 | /// Utility class used to display a wait cursor
13 | /// while a long operation takes place and
14 | /// guarantee that it will be removed on exit.
15 | ///
16 | /// Use as follows:
17 | ///
18 | /// using ( new WaitCursor() )
19 | /// {
20 | /// // Long running operation goes here
21 | /// }
22 | ///
23 | ///
24 | public class WaitCursor : IDisposable
25 | {
26 | private Cursor cursor;
27 | private Control control;
28 |
29 | public WaitCursor()
30 | {
31 | this.control = null;
32 | this.cursor = Cursor.Current;
33 | Cursor.Current = Cursors.WaitCursor;
34 | }
35 |
36 | public WaitCursor(Control control)
37 | {
38 | this.control = control;
39 | this.cursor = control.Cursor;
40 | control.Cursor = Cursors.WaitCursor;
41 | }
42 |
43 | public void Dispose()
44 | {
45 | if (control != null)
46 | control.Cursor = this.cursor;
47 | else
48 | Cursor.Current = this.cursor;
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/src/TestCentric/tests/Dialogs/DialogCreationTests.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System;
7 | using NUnit.Framework;
8 | using NSubstitute;
9 | using TestCentric.Gui.Model;
10 |
11 | namespace TestCentric.Gui.Dialogs
12 | {
13 | public class DialogCreationTests
14 | {
15 | ///
16 | /// Minimal creation test for each dialog, in order to ensure
17 | /// that no exception is thrown.
18 | ///
19 | ///
20 | // TODO: We can't test TreeBasedSettingsDialog easily because
21 | // it references the main presenter. This needs to be changed.
22 | [TestCase(typeof(AboutBox))]
23 | [TestCase(typeof(SettingsDialogBase))]
24 | [TestCase(typeof(ExtensionDialog), null)]
25 | [TestCase(typeof(ParameterDialog))]
26 | [TestCase(typeof(TestParametersDialog))]
27 | public void CreateDialog(Type dlgType, params object[] args)
28 | {
29 | Activator.CreateInstance(dlgType, args);
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/TestCentric/tests/FakeUserSettings.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | namespace TestCentric.Gui.Fakes
7 | {
8 | public class UserSettings : TestCentric.Gui.Model.Settings.UserSettings
9 | {
10 | public UserSettings() : base(new TestCentric.Gui.Model.Settings.SettingsStore()) { }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/TestCentric/tests/Presenters/Main/MainPresenterTestBase.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using NUnit.Framework;
7 | using NSubstitute;
8 |
9 | namespace TestCentric.Gui.Presenters.Main
10 | {
11 | using Elements;
12 | using Model;
13 | using Views;
14 |
15 | public class MainPresenterTestBase : PresenterTestBase
16 | {
17 | protected TestCentricPresenter _presenter;
18 |
19 | [SetUp]
20 | public void CreatePresenter()
21 | {
22 | _presenter = new TestCentricPresenter(_view, _model, new CommandLineOptions());
23 | }
24 |
25 | [TearDown]
26 | public void RemovePresenter()
27 | {
28 | _presenter = null;
29 | }
30 |
31 | protected IViewElement ViewElement(string propName)
32 | {
33 | var prop = _view.GetType().GetProperty(propName);
34 | if (prop == null)
35 | Assert.Fail($"View has no property named {propName}.");
36 |
37 | var element = prop.GetValue(_view) as IViewElement;
38 | if (element == null)
39 | Assert.Fail($"Property {propName} is not an IViewElement. It is declared as {prop.PropertyType}.");
40 |
41 | return element;
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/TestCentric/tests/Presenters/Main/PackageSettingsTests.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using NSubstitute;
7 | using NUnit.Framework;
8 |
9 | namespace TestCentric.Gui.Presenters.Main
10 | {
11 | using Elements;
12 |
13 | public class PackageSettingsTests : MainPresenterTestBase
14 | {
15 | //[TestCase("net-2.0")]
16 | //[TestCase("net-4.5")]
17 | //[TestCase("INVALID", Description = "Invalid Setting is passed on to the model")]
18 | //[TestCase("net-2.0", "net-4.5")]
19 | //public void SelectedRuntime_SettingChanged(params string[] settings)
20 | //{
21 | // foreach (var setting in settings)
22 | // {
23 | // _view.SelectedRuntime.SelectedItem.Returns(setting);
24 |
25 | // _view.SelectedRuntime.SelectionChanged += Raise.Event();
26 |
27 | // _model.PackageOverrides.Received(1)["RequestedRuntimeFramework"] = setting;
28 | // }
29 | //}
30 |
31 | public void SelectedRuntime_MultipleChanges()
32 | {
33 |
34 | }
35 |
36 | //[Test]
37 | //public void SelectedRuntime_SetToDefault()
38 | //{
39 | // _view.SelectedRuntime.SelectedItem.Returns("DEFAULT");
40 |
41 | // _view.SelectedRuntime.SelectionChanged += Raise.Event();
42 |
43 | // _model.PackageOverrides.Received(1).Remove("RequestedRuntimeFramework");
44 | //}
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/TestCentric/tests/Presenters/Main/ProjectEventTests.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System;
7 | using System.Collections.Generic;
8 | using System.Linq;
9 | using System.Text;
10 | using System.Threading.Tasks;
11 | using NSubstitute;
12 | using NUnit.Framework;
13 | using TestCentric.Gui.Elements;
14 | using TestCentric.Gui.Model;
15 |
16 | namespace TestCentric.Gui.Presenters.Main
17 | {
18 | public class ProjectEventTests : MainPresenterTestBase
19 | {
20 | [Test]
21 | public void WhenProjectIsCreated_TitleBarIsSet()
22 | {
23 | var project = new TestCentricProject(_model, "dummy.dll");
24 | _model.TestCentricProject.Returns(project);
25 |
26 | FireProjectLoadedEvent();
27 |
28 | _view.Received().Title = "TestCentric - UNNAMED.tcproj";
29 | }
30 |
31 | [Test]
32 | public void WhenProjectIsClosed_TitleBarIsSet()
33 | {
34 | FireProjectUnloadedEvent();
35 |
36 | _view.Received().Title = "TestCentric Runner for NUnit";
37 | }
38 |
39 |
40 | [Test]
41 | public void WhenProjectIsSaved_TitleBarIsSet()
42 | {
43 | // Arrange
44 | var project = new TestCentricProject(_model, "dummy.dll");
45 | _model.TestCentricProject.Returns(project);
46 | _view.DialogManager.GetFileSavePath(null, null, null, null).ReturnsForAnyArgs("TestCentric.tcproj");
47 |
48 | // Act
49 | project.SaveAs("TestCentric.tcproj");
50 | _view.SaveProjectCommand.Execute += Raise.Event();
51 |
52 | // Assert
53 | _model.Received().SaveProject("TestCentric.tcproj");
54 | _view.Received().Title = "TestCentric - TestCentric.tcproj";
55 | }
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/src/TestCentric/tests/Presenters/Main/WhenTestRunBegins.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using NSubstitute;
7 | using NUnit.Framework;
8 | using TestCentric.Gui.Model;
9 |
10 | namespace TestCentric.Gui.Presenters.Main
11 | {
12 | public class WhenTestRunBegins : MainPresenterTestBase
13 | {
14 | [SetUp]
15 | protected void SimulateTestRunStarting()
16 | {
17 | ClearAllReceivedCalls();
18 |
19 | _model.HasTests.Returns(true);
20 | _model.IsTestRunning.Returns(true);
21 | FireRunStartingEvent(1234);
22 | }
23 |
24 | [TestCase("NewProjectCommand", false)]
25 | [TestCase("OpenProjectCommand", false)]
26 | [TestCase("SaveProjectCommand", false)]
27 | [TestCase("CloseProjectCommand", false)]
28 | [TestCase("AddTestFilesCommand", false)]
29 | [TestCase("ReloadTestsCommand", false)]
30 | [TestCase("RecentFilesMenu", false)]
31 | [TestCase("ExitCommand", true)]
32 | [TestCase("SaveResultsCommand", false)]
33 | [TestCase("RunAllButton", false)]
34 | [TestCase("RunSelectedButton", false)]
35 | [TestCase("RerunButton", false)]
36 | [TestCase("RunFailedButton", false)]
37 | [TestCase("DisplayFormatButton", false)]
38 | [TestCase("RunParametersButton", false)]
39 | [TestCase("StopRunButton", true)]
40 | [TestCase("ForceStopButton", false)]
41 | public void CheckCommandEnabled(string propName, bool enabled)
42 | {
43 | ViewElement(propName).Received().Enabled = enabled;
44 | }
45 |
46 | [TestCase("StopRunButton", true)]
47 | [TestCase("ForceStopButton", false)]
48 | public void CheckElementVisibility(string propName, bool visible)
49 | {
50 | ViewElement(propName).Received().Visible = visible;
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/src/TestCentric/tests/Presenters/Main/WhenTestsAreUnloaded.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using NSubstitute;
7 | using NUnit.Framework;
8 |
9 | namespace TestCentric.Gui.Presenters.Main
10 | {
11 | public class WhenTestsAreUnloaded : MainPresenterTestBase
12 | {
13 | [SetUp]
14 | public void SimulateTestUnload()
15 | {
16 | ClearAllReceivedCalls();
17 |
18 | _model.HasTests.Returns(false);
19 | _model.IsTestRunning.Returns(false);
20 | FireTestUnloadedEvent();
21 | }
22 |
23 | [TestCase("NewProjectCommand", true)]
24 | [TestCase("OpenProjectCommand", true)]
25 | [TestCase("SaveProjectCommand", false)]
26 |
27 | [TestCase("CloseProjectCommand", false)]
28 | [TestCase("AddTestFilesCommand", false)]
29 | [TestCase("ReloadTestsCommand", false)]
30 | [TestCase("RecentFilesMenu", true)]
31 | [TestCase("ExitCommand", true)]
32 | [TestCase("SaveResultsCommand", false)]
33 | [TestCase("RunAllButton", false)]
34 | [TestCase("RunSelectedButton", false)]
35 | [TestCase("RerunButton", false)]
36 | [TestCase("RunFailedButton", false)]
37 | [TestCase("DisplayFormatButton", false)]
38 | [TestCase("RunParametersButton", false)]
39 | [TestCase("StopRunButton", false)]
40 | [TestCase("ForceStopButton", false)]
41 | public void CheckCommandEnabled(string propName, bool enabled)
42 | {
43 | ViewElement(propName).Received().Enabled = enabled;
44 | }
45 |
46 | [TestCase("StopRunButton", true)]
47 | [TestCase("ForceStopButton", false)]
48 | public void CheckElementVisibility(string propName, bool visible)
49 | {
50 | ViewElement(propName).Received().Visible = visible;
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/src/TestCentric/tests/Presenters/TestTree/WhenTestRunCompletes.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using NUnit.Framework;
7 | using NSubstitute;
8 | using TestCentric.Gui.Model;
9 |
10 | namespace TestCentric.Gui.Presenters.TestTree
11 | {
12 | public class WhenTestRunCompletes : TreeViewPresenterTestBase
13 | {
14 | [SetUp]
15 | public void SimulateTestRunCompletion()
16 | {
17 | ClearAllReceivedCalls();
18 |
19 | _model.HasTests.Returns(true);
20 | _model.HasResults.Returns(true);
21 |
22 | FireRunFinishedEvent(new ResultNode(""));
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/TestCentric/tests/Presenters/TestTree/WhenTestsAreUnloaded.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using NUnit.Framework;
7 | using NSubstitute;
8 | using TestCentric.Gui.Model;
9 |
10 | namespace TestCentric.Gui.Presenters.TestTree
11 | {
12 | public class WhenTestsAreUnloaded : TreeViewPresenterTestBase
13 | {
14 | [SetUp]
15 | public void SimulateTestUnload()
16 | {
17 | _settings.Gui.TestTree.DisplayFormat = "NUNIT_TREE";
18 |
19 | ClearAllReceivedCalls();
20 |
21 | _model.HasTests.Returns(false);
22 | _model.IsTestRunning.Returns(false);
23 | FireTestUnloadedEvent();
24 | }
25 |
26 | [Test]
27 | public void TestUnloaded_CategoryFilter_IsClosed()
28 | {
29 | // Act: unload tests
30 | FireTestUnloadedEvent();
31 |
32 | // Assert
33 | _view.CategoryFilter.Received().Close();
34 | }
35 |
36 | [Test]
37 | public void TestUnloaded_TestFilters_AreReset()
38 | {
39 | // Act: unload tests
40 | FireTestUnloadedEvent();
41 |
42 | // Assert
43 | _view.TextFilter.Received().Text = "";
44 | _view.OutcomeFilter.ReceivedWithAnyArgs().SelectedItems = null;
45 | _view.CategoryFilter.ReceivedWithAnyArgs().SelectedItems = null;
46 | }
47 |
48 | #if NYI // Add after implementation of project or package saving
49 | [TestCase("NewProjectCommand", true)]
50 | [TestCase("OpenProjectCommand", true)]
51 | [TestCase("SaveCommand", true)]
52 | [TestCase("SaveAsCommand", true)
53 | #endif
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/src/TestCentric/tests/Program.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using NUnitLite;
7 |
8 | namespace TestCentric.Engine
9 | {
10 | class Program
11 | {
12 | static int Main(string[] args)
13 | {
14 | return new AutoRun().Execute(args);
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/TestCentric/tests/TestCentric.Gui.Tests.addins:
--------------------------------------------------------------------------------
1 | # Addins file for use when developing the gui - should not be distributed
2 | # Install any NUnit extensions into the project and it will be found
3 | # when running tests in the development environment, where the engine
4 | # is copied to the output directory.
5 |
6 | # nuget v2 layout
7 | ../../extensions/NUnit.Extension.*/**/tools/
8 | ../../extensions/TestCentric.Extension.*/**/tools/
9 |
10 | #nuget v3 layout
11 | ../../../extensions/NUnit.Extension.*/**/tools/
12 | ../../../extensions/TestCentric.Extension.*/**/tools/
13 |
--------------------------------------------------------------------------------
/src/TestCentric/tests/TestCentric.Gui.Tests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | TestCentric.Gui
5 | TestCentric.Gui.Tests
6 | Exe
7 | net462
8 | ..\..\..\bin\$(Configuration)\
9 | false
10 | true
11 | TestCentric GUI Tests
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | PreserveNewest
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/src/TestCentric/tests/TextOutputDisplayTests.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System;
7 | using NUnit.Framework;
8 |
9 | namespace TestCentric.Gui.TextDisplay
10 | {
11 | [TestFixture]
12 | public abstract class TextDisplayTests
13 | {
14 | [Test]
15 | public void DisplayTest([Range(1, 5)] int num)
16 | {
17 | TestContext.Progress.WriteLine($"Immediate output from test {num}");
18 | Console.WriteLine($"Result output from test {num}");
19 | TestContext.Progress.WriteLine($"More immediate output from test {num}");
20 | }
21 | }
22 |
23 | public class SequentialTextDisplay : TextDisplayTests
24 | { }
25 |
26 | [Parallelizable(ParallelScope.Children)]
27 | public class ParallelTextDisplay : TextDisplayTests
28 | { }
29 | }
30 |
--------------------------------------------------------------------------------
/src/TestCentric/tests/Views/CommonViewTests.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Collections.Generic;
7 | using System.Reflection;
8 | using NUnit.Framework;
9 |
10 | namespace TestCentric.Gui.Views
11 | {
12 | using Elements;
13 |
14 | [TestFixture(typeof(TestCentricMainView))]
15 | //[TestFixture(typeof(TestTreeView))]
16 | [Platform(Exclude = "Linux", Reason = "Uninitialized form causes an error in Travis-CI")]
17 | public class CommonViewTests where T : new()
18 | {
19 | protected T View { get; private set; }
20 |
21 | [SetUp]
22 | public void CreateView()
23 | {
24 | this.View = new T();
25 | }
26 |
27 | [TestCaseSource("GetViewElementProperties")]
28 | public void ViewElementsAreInitialized(PropertyInfo prop)
29 | {
30 | var element = prop.GetValue(View, new object[0]) as IViewElement;
31 |
32 | Assert.That(element, Is.Not.Null, $"Element {prop.Name} was not initialized");
33 | }
34 |
35 | static protected IEnumerable GetViewElementProperties()
36 | {
37 | foreach (PropertyInfo prop in typeof(T).GetProperties())
38 | {
39 | if (typeof(IViewElement).IsAssignableFrom(prop.PropertyType))
40 | yield return prop;
41 | }
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/TestCentric/tests/Views/ErrorsAndFailuresViewTests.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Windows.Forms;
7 | using NUnit.Framework;
8 |
9 | namespace TestCentric.Gui.Views
10 | {
11 | [TestFixture]
12 | [Platform(Exclude = "Linux", Reason = "Uninitialized form causes an error in Travis-CI")]
13 | public class ErrorsAndFailuresViewTests : ControlTester
14 | {
15 | [OneTimeSetUp]
16 | public void CreateForm()
17 | {
18 | this.Control = new ErrorsAndFailuresView();
19 | }
20 |
21 | [OneTimeTearDown]
22 | public void CloseForm()
23 | {
24 | this.Control.Dispose();
25 | }
26 |
27 | [Test]
28 | public void ControlsExist()
29 | {
30 | AssertControlExists("header", typeof(Label));
31 | AssertControlExists("panel1", typeof(Panel));
32 | AssertControlExists("testResultSubView", typeof(TestResultSubView));
33 |
34 | var panelTester = new ControlTester(_control.Controls["panel1"]);
35 | panelTester.AssertControlExists("flowLayoutPanel", typeof(FlowLayoutPanel));
36 | panelTester.AssertControlExists("tabSplitter", typeof(Splitter));
37 | panelTester.AssertControlExists("errorBrowser", typeof(NUnit.UiException.Controls.ErrorBrowser));
38 |
39 | var flowLayoutPanelTester = new ControlTester(_control.Controls["panel1"].Controls["flowLayoutPanel"]);
40 | flowLayoutPanelTester.AssertControlExists("detailList", typeof(ListBox));
41 | flowLayoutPanelTester.AssertControlExists("testOutputSubView", typeof(TestOutputSubView));
42 | }
43 |
44 | //[Test]
45 | //public void ControlsArePositionedCorrectly()
46 | //{
47 | // AssertControlsAreStackedVertically( "detailList", "tabSplitter", "errorBrowser" );
48 | //}
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/src/TestCentric/tests/Views/TestResultItemTests.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using NUnit.Framework;
7 |
8 | namespace TestCentric.Gui.Views
9 | {
10 | [TestFixture]
11 | public class TestResultItemTests
12 | {
13 | [TestCase("message", "stack trace string")]
14 | [TestCase("message", null)]
15 | [TestCase(null, "stack trace string")]
16 | public void ToStringTest(string message, string stackTrace)
17 | {
18 | var item = new TestResultItem("STATUS", "dummy test name", message, stackTrace);
19 | Assert.That(item.ToString(), Is.Not.Null);
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/TestCentric/tests/VisualStateTestBase.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System;
7 | using System.Collections.Generic;
8 | using System.Linq;
9 | using System.Text;
10 | using System.Threading.Tasks;
11 | using System.Windows.Forms;
12 |
13 | namespace TestCentric.Gui
14 | {
15 | public class VisualStateTestBase
16 | {
17 | // Flags for use with VTN
18 | protected const int EXP = 1;
19 | protected const int CHK = 2;
20 | protected const int SEL = 4;
21 | protected const int TOP = 8;
22 |
23 | protected static VisualTreeNode VTN(string name, int flags = 0, params VisualTreeNode[] childNodes)
24 | => VisualStateTestData.VTN(name, flags, childNodes);
25 |
26 | // Helper used to create a TreeNode for use in the tests
27 | // NOTE: Unlike the TreeNodes used in the production app, the Tag
28 | // is not set because VisualState doesn't make use of it.
29 | protected static TreeNode TN(string name, params TreeNode[] childNodes)
30 | => VisualStateTestData.TN(name, childNodes);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/TestModel/model/AssertionResult.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Xml;
7 |
8 | namespace TestCentric.Gui.Model
9 | {
10 | public struct AssertionResult
11 | {
12 | public AssertionResult(XmlNode assertion, string status)
13 | : this(assertion)
14 | {
15 | Status = status;
16 | }
17 |
18 | public AssertionResult(XmlNode assertion)
19 | {
20 | Status = assertion.GetAttribute("label") ?? assertion.GetAttribute("result");
21 | Message = assertion.SelectSingleNode("message")?.InnerText;
22 | StackTrace = assertion.SelectSingleNode("stack-trace")?.InnerText;
23 | }
24 |
25 | public string Status { get; }
26 | public string Message { get; }
27 | public string StackTrace { get; }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/TestModel/model/Filter/ITestCentricTestFilter.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Collections.Generic;
7 |
8 | namespace TestCentric.Gui.Model.Filter
9 | {
10 | ///
11 | /// Provides filter functionality: by outcome, by duration, by category...
12 | ///
13 | public interface ITestCentricTestFilter
14 | {
15 | ///
16 | /// Filters the loaded TestNodes by outcome (for example: 'Passed', 'Failed' or 'Not run')
17 | ///
18 | IEnumerable OutcomeFilter { get; set; }
19 |
20 | ///
21 | /// Filters the loaded TestNodes by matching a text (for example: Namespace, Class name or test method name - filter is case insensitive)
22 | ///
23 | string TextFilter { get; set; }
24 |
25 | ///
26 | /// Filters the loaded TestNodes by test categories. Use item 'No category' to filter for tests without any test category.
27 | ///
28 | IEnumerable CategoryFilter { get; set; }
29 |
30 | ///
31 | /// Returns the list of available test categories defined in the loaded TestNodes + item 'No category'
32 | ///
33 | IEnumerable AllCategories { get; }
34 |
35 | ///
36 | /// Checks if any filter is active
37 | ///
38 | bool IsActive { get; }
39 |
40 | ///
41 | /// Clear all actives filters and reset them to default
42 | ///
43 | void ResetAll(bool suppressFilterChangedEvent = false);
44 |
45 | ///
46 | /// Init filter after a project is loaded
47 | ///
48 | void Init();
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/src/TestModel/model/Filter/ITestFilter.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Collections.Generic;
7 |
8 | namespace TestCentric.Gui.Model.Filter
9 | {
10 | ///
11 | /// Interface for all test filters
12 | ///
13 | internal interface ITestFilter
14 | {
15 | ///
16 | /// Unqiue identifier of the filter
17 | ///
18 | string FilterId { get; }
19 |
20 | ///
21 | /// The filter condition
22 | ///
23 | IEnumerable Condition { get; set; }
24 |
25 | ///
26 | /// Reset the filter condition to its default state
27 | ///
28 | void Reset();
29 |
30 | ///
31 | /// Init filter after a project is loaded
32 | ///
33 | void Init();
34 |
35 | ///
36 | /// Checks if the testNode matches the filter condition
37 | ///
38 | bool IsMatching(TestNode testNode);
39 |
40 | ///
41 | /// Checks if the filter is active
42 | ///
43 | bool IsActive { get; }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/TestModel/model/Filter/TextFilter.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System;
7 | using System.Collections.Generic;
8 | using System.Linq;
9 |
10 | namespace TestCentric.Gui.Model.Filter
11 | {
12 | ///
13 | /// Filters the TestNodes by matching a text (for example: Namespace, Class name or test method name - filter is case insensitive)
14 | ///
15 | public class TextFilter : ITestFilter
16 | {
17 | private string _condition = string.Empty;
18 |
19 | public string FilterId => "TextFilter";
20 |
21 | public IEnumerable Condition
22 | {
23 | get { return new List() { _condition }; }
24 | set { _condition = value.FirstOrDefault(); }
25 | }
26 |
27 | public bool IsActive => string.IsNullOrEmpty( _condition) == false;
28 |
29 | public bool IsMatching(TestNode testNode)
30 | {
31 | if (string.IsNullOrEmpty(_condition))
32 | {
33 | return true;
34 | }
35 |
36 | return testNode.FullName.IndexOf(_condition, StringComparison.InvariantCultureIgnoreCase) > -1;
37 | }
38 |
39 | public void Reset()
40 | {
41 | _condition = string.Empty;
42 | }
43 |
44 | public void Init()
45 | {
46 | _condition = string.Empty;
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/TestModel/model/ITestItem.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | namespace TestCentric.Gui.Model
7 | {
8 | ///
9 | /// ITestItem is the common interface shared by TestNodes
10 | /// and TestGroups and allows either to be selected in
11 | /// the tree.
12 | ///
13 | public interface ITestItem
14 | {
15 | ///
16 | /// The name of this item
17 | ///
18 | string Name { get; }
19 |
20 | ///
21 | /// Get a TestFilter for use in selecting this item
22 | /// to be run by the engine.
23 | ///
24 | ///
25 | TestFilter GetTestFilter();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/TestModel/model/ITestServices.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using TestCentric.Engine;
7 | using TestCentric.Engine.Services;
8 |
9 | namespace TestCentric.Gui.Model
10 | {
11 | ///
12 | /// ITestServices extends IServiceLocator in order to
13 | /// conveniently cache commonly used services.
14 | ///
15 | public interface ITestServices : IServiceLocator
16 | {
17 | IExtensionService ExtensionService { get; }
18 | IResultService ResultService { get; }
19 | // TODO: Figure out how to handle this
20 | //IProjectService ProjectService { get; }
21 | ITestAgentInfo TestAgentService { get; }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/TestModel/model/RunState.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | namespace TestCentric.Gui.Model
7 | {
8 | ///
9 | /// The RunState enum indicates whether a test can be executed.
10 | ///
11 | public enum RunState
12 | {
13 | ///
14 | /// We don't know the RunState
15 | ///
16 | Unknown,
17 |
18 | ///
19 | /// The test is not runnable.
20 | ///
21 | NotRunnable,
22 |
23 | ///
24 | /// The test is runnable.
25 | ///
26 | Runnable,
27 |
28 | ///
29 | /// The test can only be run explicitly
30 | ///
31 | Explicit,
32 |
33 | ///
34 | /// The test has been skipped. This val may
35 | /// appear on a Test when certain attributes
36 | /// are used to skip the test.
37 | ///
38 | Skipped,
39 |
40 | ///
41 | /// The test has been ignored. May appear on
42 | /// a Test, when the IgnoreAttribute is used.
43 | ///
44 | Ignored
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/TestModel/model/Services/IAsemblyWatcher.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System;
7 | using System.Collections.Generic;
8 |
9 | namespace TestCentric.Gui.Model.Services
10 | {
11 | public delegate void AssemblyChangedHandler(string fullPath);
12 | public interface IAsemblyWatcher : IDisposable
13 | {
14 | ///
15 | /// Stops watching for changes.
16 | /// To release resources call FreeResources.
17 | ///
18 | void Stop();
19 |
20 | ///
21 | /// Starts watching for assembly changes.
22 | /// You need to call Setup before start watching.
23 | ///
24 | void Start();
25 |
26 | ///
27 | /// Initializes the watcher with assemblies to observe for changes.
28 | ///
29 | /// The delay in ms.
30 | /// The assemblies.
31 |
32 | void Setup(int delayInMs, IList assemblies);
33 |
34 |
35 | ///
36 | /// Initializes the watcher with assemblies to observe for changes.
37 | ///
38 | /// The delay in ms.
39 | /// Name of the assembly file.
40 | void Setup(int delayInMs, string assemblyFileName);
41 |
42 | ///
43 | /// Releases all resources held by the watcher.
44 | ///
45 |
46 | ///
47 | /// Occurs when an assembly being watched has changed.
48 | ///
49 | event AssemblyChangedHandler AssemblyChanged;
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/src/TestModel/model/Services/SettingsService.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System;
7 | using System.IO;
8 | using TestCentric.Gui.Model.Settings;
9 |
10 | namespace TestCentric.Gui.Model.Services
11 | {
12 | ///
13 | /// Summary description for UserSettingsService.
14 | ///
15 | public class SettingsService : SettingsStore
16 | {
17 | private const string SETTINGS_FILE = "TestCentricSettings.xml";
18 | private static readonly string APPLICATION_DIRECTORY =
19 | Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "TestCentric");
20 |
21 | public SettingsService(bool writeable)
22 | : base(Path.Combine(APPLICATION_DIRECTORY, SETTINGS_FILE), writeable) { }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/TestModel/model/Settings/MainFormSettings.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Drawing;
7 |
8 | namespace TestCentric.Gui.Model.Settings
9 | {
10 | public class MainFormSettings : SettingsGroup
11 | {
12 | public MainFormSettings(ISettings settings, string prefix)
13 | : base(settings, prefix + "MainForm") { }
14 |
15 | public Point Location
16 | {
17 | get { return GetSetting(nameof(Location), new Point(10, 10)); }
18 | set { SaveSetting(nameof(Location), value); }
19 | }
20 |
21 | public Size Size
22 | {
23 | get { return GetSetting(nameof(Size), new Size(700, 400)); }
24 | set { SaveSetting(nameof(Size), value); }
25 | }
26 |
27 | public bool Maximized
28 | {
29 | get { return GetSetting(nameof(Maximized), false); }
30 | set { SaveSetting(nameof(Maximized), value); }
31 | }
32 |
33 | public int SplitPosition
34 | {
35 | get { return GetSetting(nameof(SplitPosition), 290); }
36 | set { SaveSetting(nameof(SplitPosition), value); }
37 | }
38 |
39 | public bool ShowStatusBar
40 | {
41 | get { return GetSetting(nameof(ShowStatusBar), true); }
42 | set { SaveSetting(nameof(ShowStatusBar), value); }
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/TestModel/model/Settings/MiniFormSettings.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Drawing;
7 |
8 | namespace TestCentric.Gui.Model.Settings
9 | {
10 | public class MiniFormSettings : SettingsGroup
11 | {
12 | public MiniFormSettings(ISettings settings, string prefix)
13 | : base(settings, prefix + "MiniForm") { }
14 |
15 | public Point Location
16 | {
17 | get { return GetSetting(nameof(Location), new Point(10, 10)); }
18 | set { SaveSetting(nameof(Location), value); }
19 | }
20 |
21 | public Size Size
22 | {
23 | get { return GetSetting(nameof(Size), new Size(700, 400)); }
24 | set { SaveSetting(nameof(Size), value); }
25 | }
26 |
27 | public bool Maximized
28 | {
29 | get { return GetSetting(nameof(Maximized), false); }
30 | set { SaveSetting(nameof(Maximized), value); }
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/TestModel/model/Settings/RecentProjectsSettings.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | namespace TestCentric.Gui.Model.Settings
7 | {
8 | public class RecentProjectsSettings : SettingsGroup
9 | {
10 | public RecentProjectsSettings(ISettings settings, string prefix)
11 | : base(settings, prefix + "RecentProjects") { }
12 |
13 | public int MaxFiles
14 | {
15 | get { return GetSetting(nameof(MaxFiles), 24); }
16 | set { SaveSetting(nameof(MaxFiles), value); }
17 | }
18 |
19 | public bool CheckFilesExist
20 | {
21 | get { return GetSetting(nameof(CheckFilesExist), true); }
22 | set { SaveSetting(nameof(CheckFilesExist), value); }
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/TestModel/model/Settings/TextOutputSettings.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | namespace TestCentric.Gui.Model.Settings
7 | {
8 | public class TextOutputSettings : SettingsGroup
9 | {
10 | public TextOutputSettings(ISettings settings, string prefix)
11 | : base(settings, prefix + "TextOutput") { }
12 |
13 | public bool WordWrapEnabled
14 | {
15 | get { return GetSetting(nameof(WordWrapEnabled), true); }
16 | set { SaveSetting(nameof(WordWrapEnabled), value); }
17 | }
18 |
19 | public string Labels
20 | {
21 | get { return GetSetting(nameof(Labels), "ON").ToUpper(); }
22 | set { SaveSetting(nameof(Labels), value); }
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/TestModel/model/Settings/UserSettings.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | namespace TestCentric.Gui.Model.Settings
7 | {
8 | public class UserSettings : SettingsGroup
9 | {
10 | public UserSettings(ISettings settings)
11 | : base(settings, "TestCentric") { }
12 |
13 | public GuiSettings Gui
14 | {
15 | get { return new GuiSettings(_settingsService, GroupPrefix); }
16 | }
17 |
18 | public EngineSettings Engine
19 | {
20 | get { return new EngineSettings(_settingsService, GroupPrefix); }
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/TestModel/model/TestCentric.Gui.Model.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | TestCentric.Gui.Model
5 | TestCentric.Gui.Model
6 | net462
7 | ..\..\..\bin\$(Configuration)\
8 | false
9 | true
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/TestModel/model/TestModelBuilder.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System;
7 | using System.Collections.Generic;
8 | using System.Linq;
9 | using System.Text;
10 | using System.Threading.Tasks;
11 |
12 | namespace TestCentric.Gui.Model
13 | {
14 | class TestModelBuilder
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/TestModel/model/TestServices.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System;
7 | using TestCentric.Engine;
8 | using TestCentric.Engine.Services;
9 |
10 | namespace TestCentric.Gui.Model
11 | {
12 | ///
13 | /// TestServices caches commonly used services.
14 | ///
15 | public class TestServices : ITestServices
16 | {
17 | private IServiceLocator _services;
18 | private ITestEngine _testEngine;
19 |
20 | public TestServices(ITestEngine testEngine)
21 | {
22 | _testEngine = testEngine;
23 | _services = testEngine.Services;
24 |
25 | ExtensionService = GetService();
26 | ResultService = GetService();
27 | TestAgentService = GetService();
28 | }
29 |
30 | #region ITestServices Implementation
31 |
32 | public IExtensionService ExtensionService { get; }
33 |
34 | public IResultService ResultService { get; }
35 |
36 | public ITestAgentInfo TestAgentService { get; }
37 |
38 | #endregion
39 |
40 | #region IServiceLocator Implementation
41 |
42 | public T GetService() where T : class
43 | {
44 | return _services.GetService();
45 | }
46 |
47 | public object GetService(Type serviceType)
48 | {
49 | return _services.GetService(serviceType);
50 | }
51 |
52 | #endregion
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/src/TestModel/model/TestStartNotice.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Xml;
7 |
8 | namespace TestCentric.Gui.Model
9 | {
10 | public class TestStartNotice
11 | {
12 | public TestStartNotice(XmlNode xmlNode)
13 | {
14 | Id = xmlNode.GetAttribute("id");
15 | Name = xmlNode.GetAttribute("name");
16 | FullName = xmlNode.GetAttribute("fullname");
17 | }
18 |
19 | public string Id { get; private set; }
20 | public string Name { get; private set; }
21 | public string FullName { get; private set; }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/TestModel/model/TestStatus.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | namespace TestCentric.Gui.Model
7 | {
8 | ///
9 | /// The TestStatus enum indicates the suiteResult of running a test
10 | ///
11 | public enum TestStatus
12 | {
13 | ///
14 | /// The test was inconclusive
15 | ///
16 | Inconclusive,
17 |
18 | ///
19 | /// The test has skipped
20 | ///
21 | Skipped,
22 |
23 | ///
24 | /// The test succeeded
25 | ///
26 | Passed,
27 |
28 | ///
29 | /// There was a warning
30 | ///
31 | Warning,
32 |
33 | ///
34 | /// The test failed
35 | ///
36 | Failed
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/TestModel/tests/AvailableRuntimesTest.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System;
7 | using System.Collections.Generic;
8 | using TestCentric.Engine;
9 | using NUnit.Framework;
10 | using TestCentric.Gui.Model.Fakes;
11 | using RuntimeFramework = TestCentric.Gui.Model.Fakes.RuntimeFramework;
12 |
13 | namespace TestCentric.Gui.Model
14 | {
15 | public class AvailableRuntimesTest
16 | {
17 | [Test]
18 | public void RuntimesSupportedByEngineAreAvailable()
19 | {
20 | var mockEngine = new MockTestEngine().WithRuntimes(
21 | new RuntimeFramework("net-4.5", new Version(4, 5)),
22 | new RuntimeFramework("net-4.0", new Version(4, 0)));
23 |
24 | var model = new TestModel(mockEngine);
25 |
26 | Assert.That(model.AvailableRuntimes.Count, Is.EqualTo(2));
27 | Assert.That(model.AvailableRuntimes, Has.One.Property("Id").EqualTo("net-4.5"));
28 | Assert.That(model.AvailableRuntimes, Has.One.Property("Id").EqualTo("net-4.0"));
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/TestModel/tests/Fakes/AvailableRuntimesService.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Collections.Generic;
7 | using TestCentric.Engine;
8 | using TestCentric.Engine.Services;
9 |
10 | namespace TestCentric.Gui.Model.Fakes
11 | {
12 | public class AvailableRuntimesService : IAvailableRuntimes
13 | {
14 | private List _availableRuntimes = new List();
15 |
16 | public void AddRuntimes(params IRuntimeFramework[] runtimes)
17 | {
18 | _availableRuntimes.AddRange(runtimes);
19 | }
20 |
21 | public IList AvailableRuntimes
22 | {
23 | get { return _availableRuntimes; }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/TestModel/tests/Fakes/ResultService.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System;
7 | using TestCentric.Engine.Services;
8 | using TestCentric.Engine.Extensibility;
9 |
10 | namespace TestCentric.Gui.Model.Fakes
11 | {
12 | public class ResultService : IResultService
13 | {
14 | public string[] Formats
15 | {
16 | get
17 | {
18 | throw new NotImplementedException();
19 | }
20 | }
21 |
22 | public IResultWriter GetResultWriter(string format, object[] args)
23 | {
24 | throw new NotImplementedException();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/TestModel/tests/Fakes/RuntimeFramework.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System;
7 | using TestCentric.Engine;
8 |
9 | namespace TestCentric.Gui.Model.Fakes
10 | {
11 | public class RuntimeFramework : IRuntimeFramework
12 | {
13 | public RuntimeFramework(string id, Version version)
14 | {
15 | Id = id;
16 | FrameworkVersion = version.Build >= 0
17 | ? new Version(version.Major, version.Minor)
18 | : version;
19 | ClrVersion = version;
20 | DisplayName = id;
21 | }
22 |
23 | public string Id { get; }
24 |
25 | public Version FrameworkVersion { get; }
26 |
27 | public Version ClrVersion { get; }
28 |
29 | public string DisplayName { get; set; }
30 |
31 | public string Profile { get; set; }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/TestModel/tests/Fakes/ServiceLocator.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System;
7 | using System.Collections.Generic;
8 | using TestCentric.Engine;
9 |
10 | namespace TestCentric.Gui.Model.Fakes
11 | {
12 | public class ServiceLocator : IServiceLocator
13 | {
14 | private Dictionary _services = new Dictionary();
15 |
16 | public void AddService(T service)
17 | {
18 | _services.Add(typeof(T), service);
19 | }
20 |
21 | public object GetService(Type serviceType)
22 | {
23 | return _services.ContainsKey(serviceType)
24 | ? _services[serviceType]
25 | : null;
26 | }
27 |
28 | public T GetService() where T : class
29 | {
30 | return (T)GetService(typeof(T));
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/TestModel/tests/Fakes/TestAgentInfoService.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Collections.Generic;
7 | using TestCentric.Engine;
8 | using TestCentric.Engine.Services;
9 |
10 | namespace TestCentric.Gui.Model.Fakes
11 | {
12 | public class TestAgentInfoService : ITestAgentInfo
13 | {
14 | public IList GetAvailableAgents()
15 | {
16 | return new TestAgentInfo[0];
17 | }
18 |
19 | public IList GetAgentsForPackage(TestPackage package)
20 | {
21 | return new TestAgentInfo[0];
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/TestModel/tests/Program.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using NUnitLite;
7 |
8 | namespace TestCentric.Engine
9 | {
10 | class Program
11 | {
12 | static int Main(string[] args)
13 | {
14 | return new AutoRun().Execute(args);
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/TestModel/tests/ResultNodeTests.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using NUnit.Framework;
7 |
8 | namespace TestCentric.Gui.Model
9 | {
10 | [TestFixture]
11 | public class ResultNodeTests
12 | {
13 | [Test]
14 | [SetCulture("fr-FR")]
15 | public void CreateResultNode_CurrentCultureWithDifferentDelimiter_DoesNotThrowException()
16 | {
17 | TestDelegate newResultNode = () =>
18 | {
19 | var resultNode = new ResultNode("");
20 | };
21 | Assert.DoesNotThrow(newResultNode);
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/TestModel/tests/Services/SettingsServiceTests.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using NUnit.Framework;
7 |
8 | namespace TestCentric.Gui.Model.Services
9 | {
10 | public class SettingsServiceTests
11 | {
12 | private SettingsService _settingsService;
13 |
14 | [SetUp]
15 | public void CreateService()
16 | {
17 | _settingsService = new SettingsService(false);
18 | }
19 |
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/TestModel/tests/Settings/FakeSettingsService.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | namespace TestCentric.Gui.Model.Settings
7 | {
8 | public class FakeSettingsService : SettingsStore
9 | {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/TestModel/tests/TestCentric.Gui.Model.Tests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | TestCentric.Gui.Model
5 | TestCentric.Gui.Model.Tests
6 | Exe
7 | net462
8 | ..\..\..\bin\$(Configuration)\
9 | false
10 | true
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/src/TestModel/tests/TestExecutionTests.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System;
7 | using System.Collections.Generic;
8 | using System.Linq;
9 | using System.Text;
10 | using System.Threading.Tasks;
11 | using NUnit.Framework;
12 | using NSubstitute;
13 | using TestCentric.Gui.Model.Fakes;
14 |
15 | #if false // Not yet working
16 | namespace TestCentric.Gui.Model
17 | {
18 | public class TestExecutionTests
19 | {
20 | private static TestNode TEST_CASE_NODE = new TestNode(
21 | XmlHelper.CreateXmlNode(""));
22 | private static TestNode TEST_SUITE_NODE = new TestNode(XmlHelper.CreateXmlNode(""));
23 |
24 | [Test]
25 | public void RunSingleTest()
26 | {
27 | var engine = Substitute.For();
28 | var runner = Substitute.For();
29 | engine.GetRunner(null).ReturnsForAnyArgs(runner);
30 | Assert.That(engine.GetRunner(new TestPackage()), Is.SameAs(runner));
31 |
32 | var model = new TestModel(engine);
33 |
34 | model.RunTests(TEST_CASE_NODE);
35 | //runner.Received().RunAsync(model.Events as ITestEventListener, NUnit.Engine.TestFilter.Empty);
36 | }
37 | }
38 | }
39 | #endif
40 |
--------------------------------------------------------------------------------
/src/TestModel/tests/TestSelectionTests.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Linq;
7 | using NUnit.Framework;
8 |
9 | namespace TestCentric.Gui.Model
10 | {
11 | public class TestSelectionTests
12 | {
13 | private TestSelection _selection;
14 |
15 | [SetUp]
16 | public void CreateSelection()
17 | {
18 | _selection = new TestSelection();
19 | _selection.Add(MakeTestNode("1", "Tom", "Passed"));
20 | _selection.Add(MakeTestNode("2", "Dick", "Failed"));
21 | _selection.Add(MakeTestNode("3", "Harry", "Passed"));
22 | }
23 |
24 | [Test]
25 | public void RemoveTestNode()
26 | {
27 | _selection.RemoveId("2");
28 | Assert.That(_selection.Count, Is.EqualTo(2));
29 | }
30 |
31 | private TestNode MakeTestNode(string id, string name, string result)
32 | {
33 | return new TestNode(XmlHelper.CreateXmlNode(string.Format("", id, name, result)));
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/testcentric.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/src/testcentric.snk
--------------------------------------------------------------------------------
/src/tests/aspnetcore-test/AspNetCoreTest.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using NUnit.Framework;
7 | using Microsoft.AspNetCore.Components.Forms;
8 |
9 | // Test which resolves issue #1203
10 | namespace Test1
11 | {
12 | [TestFixture]
13 | public class AspNetCoreTest
14 | {
15 | [Test]
16 | public void WithoutFramework()
17 | {
18 | Assert.Pass();
19 | }
20 |
21 | [Test]
22 | public void WithFramework()
23 | {
24 | InputCheckbox checkbox = new InputCheckbox();
25 | Assert.Pass();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/tests/aspnetcore-test/aspnetcore-test.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp3.1;net5.0;net6.0;net7.0
5 | ..\..\..\bin\$(Configuration)\
6 | Library
7 | false
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/tests/hung-tests/FastFixture.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using NUnit.Framework;
7 |
8 | namespace NUnit.Tests
9 | {
10 | // The tests in this fixture run without delay, usually before we get a chance to stop the run
11 | public class FastFixture
12 | {
13 | [SetUp]
14 | public void SetUp()
15 | {
16 | TestContext.Progress.WriteLine($"SetUp executing");
17 | }
18 |
19 | [TearDown]
20 | public void TearDown()
21 | {
22 | TestContext.Progress.WriteLine($"TearDown executing");
23 | }
24 |
25 | [Test]
26 | public void TestMethod([Range(1, 5)] int i)
27 | {
28 | TestContext.Progress.WriteLine($"Test executing");
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/tests/hung-tests/HangingFixture.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Threading;
7 | using NUnit.Framework;
8 |
9 | namespace NUnit.Tests
10 | {
11 | public class HangingFixture
12 | {
13 | [SetUp]
14 | public void SetUp()
15 | {
16 | TestContext.Progress.WriteLine($"SetUp executing");
17 | }
18 |
19 | [TearDown]
20 | public void TearDown()
21 | {
22 | TestContext.Progress.WriteLine($"TearDown executing");
23 | }
24 |
25 | [Test]
26 | public void HangingTest()
27 | {
28 | TestContext.Progress.WriteLine("Test starting");
29 | while (true)
30 | {
31 | Thread.Sleep(3000);
32 | TestContext.Progress.WriteLine("Test continuing");
33 | }
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/tests/hung-tests/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using NUnit.Framework;
7 |
8 | [assembly: Parallelizable(ParallelScope.Fixtures)]
9 |
--------------------------------------------------------------------------------
/src/tests/hung-tests/SlowFixture.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Threading;
7 | using NUnit.Framework;
8 |
9 | namespace NUnit.Tests
10 | {
11 | // The tests in this fixture contain a delay, so we can exercise the stop button
12 | public class SlowFixture
13 | {
14 | [SetUp]
15 | public void SetUp()
16 | {
17 | TestContext.Progress.WriteLine($"SetUp starting");
18 | Thread.Sleep(3000);
19 | TestContext.Progress.WriteLine($"SetUp complete");
20 | }
21 |
22 | [TearDown]
23 | public void TearDown()
24 | {
25 | TestContext.Progress.WriteLine($"TearDown starting");
26 | Thread.Sleep(3000);
27 | TestContext.Progress.WriteLine($"TearDown complete");
28 | }
29 |
30 | [Test]
31 | public void TestMethod([Range(1, 5)] int i)
32 | {
33 | TestContext.Progress.WriteLine($"Test starting");
34 | Thread.Sleep(3000);
35 | TestContext.Progress.WriteLine($"Test complete");
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/tests/hung-tests/hung-tests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | NUnit.Tests
4 | net35;net462;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0
5 | ..\..\..\bin\$(Configuration)\
6 | true
7 | false
8 | false
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/src/tests/mock-assembly-v2/mock-assembly-v2.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | NUnit.Tests
4 | net20
5 | mock-assembly
6 | ..\..\..\bin\$(Configuration)\v2-tests\
7 | false
8 | true
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/tests/mock-assembly-x86/mock-assembly-x86.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | NUnit.Tests
5 | net35;net462
6 | true
7 | ..\..\testcentric.snk
8 | ..\..\..\bin\$(Configuration)\
9 | true
10 | x86
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/tests/mock-assembly/mock-assembly.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | NUnit.Tests
5 | net35;net462;net48;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0
6 | true
7 | ..\..\testcentric.snk
8 | ..\..\..\bin\$(Configuration)\
9 | true
10 | false
11 | false
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/src/tests/windows-forms-test/WindowsFormsTest.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) Charlie Poole and TestCentric contributors.
3 | // Licensed under the MIT License. See LICENSE file in root directory.
4 | // ***********************************************************************
5 |
6 | using System.Windows.Forms;
7 | using NUnit.Framework;
8 |
9 | // Test which resolves issue #1203
10 | namespace Test1
11 | {
12 | [TestFixture]
13 | public class WindowsFormsTest
14 | {
15 | [Test]
16 | public void WithoutFramework()
17 | {
18 | Assert.Pass();
19 | }
20 |
21 | [Test]
22 | public void WithFramework()
23 | {
24 | var checkbox = new CheckBox();
25 | Assert.Pass();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/tests/windows-forms-test/windows-forms-test.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net5.0-windows;net6.0-windows;net7.0-windows
5 | true
6 | ..\..\..\bin\$(Configuration)\
7 | false
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/testcentric-gui.sln.licenseheader:
--------------------------------------------------------------------------------
1 | extensions: designer.cs generated.cs external.cs
2 | extensions: .cs .cpp .h
3 | // ***********************************************************************
4 | // Copyright (c) 2018 Charlie Poole
5 | //
6 | // Permission is hereby granted, free of charge, to any person obtaining
7 | // a copy of this software and associated documentation files (the
8 | // "Software"), to deal in the Software without restriction, including
9 | // without limitation the rights to use, copy, modify, merge, publish,
10 | // distribute, sublicense, and/or sell copies of the Software, and to
11 | // permit persons to whom the Software is furnished to do so, subject to
12 | // the following conditions:
13 | //
14 | // The above copyright notice and this permission notice shall be
15 | // included in all copies or substantial portions of the Software.
16 | //
17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
21 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 | // ***********************************************************************
25 |
--------------------------------------------------------------------------------
/testcentric.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/testcentric.ico
--------------------------------------------------------------------------------
/testcentric.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TestCentric/testcentric-gui/b510fb41e2a136065b562115f23c2f70fb5b6720/testcentric.png
--------------------------------------------------------------------------------
/tools/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------