diff --git a/.github/workflows/dotnet-desktop.yml b/.github/workflows/dotnet-desktop.yml
index 744e4ca..3e05bbe 100644
--- a/.github/workflows/dotnet-desktop.yml
+++ b/.github/workflows/dotnet-desktop.yml
@@ -1,34 +1,54 @@
-name: Build and Test .NET Projects
+name: CodeQL Analysis
-on:
- push:
- branches:
- - master # Adjust the branch name as needed
+on: [pull_request]
jobs:
build-and-test:
strategy:
+ fail-fast: false
matrix:
- dotnet-version: ['6.x', '7.x', '8.x'] # Specify the desired versions
-
- runs-on: ubuntu-latest
+ language: [ 'csharp' ]
+ # CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
+ # Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
+ # Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
+ # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
+ runs-on: ubuntu-latest
+
steps:
- - name: Checkout
- uses: actions/checkout@v2
-
- # Set up .NET Core for each version
- - name: Setup .NET Core
- uses: actions/setup-dotnet@v1
- with:
- dotnet-version: ${{ matrix.dotnet-version }}
-
- # Restore and build the application
- - name: Restore and Build
- run: |
- dotnet restore
- dotnet build
-
- # Run tests using the existing restore
- - name: Run Tests
- run: dotnet test
+ - name: Checkout repository
+ uses: actions/checkout@v4
+
+ # Initializes the CodeQL tools for scanning.
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@v3
+ with:
+ languages: ${{ matrix.language }}
+ # If you wish to specify custom queries, you can do so here or in a config file.
+ # By default, queries listed here will override any specified in a config file.
+ # Prefix the list here with "+" to use these queries and those in the config file.
+
+ # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
+ # queries: security-extended,security-and-quality
+
+
+ # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
+ # If this step fails, then you should remove it and run the build manually (see below)
+ - name: Autobuild
+ uses: github/codeql-action/autobuild@v3
+
+ # ℹ️ Command-line programs to run using the OS shell.
+ # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
+
+ # If the Autobuild fails above, remove it and uncomment the following three lines.
+ # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
+
+ # - run: |
+ # echo "Run, Build Application using script"
+ # ./location_of_script_within_repo/buildscript.sh
+
+ - name: Perform CodeQL Analysis
+ uses: github/codeql-action/analyze@v3
+ with:
+ category: "/language:${{matrix.language}}" # Set up .NET Core for each version
+
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
new file mode 100644
index 0000000..4e4b934
--- /dev/null
+++ b/.github/workflows/tests.yml
@@ -0,0 +1,41 @@
+name: Run Windows Tests
+
+on: [push, pull_request]
+
+jobs:
+
+ build:
+
+ strategy:
+ matrix:
+ language: [ 'csharp' ]
+ configuration: [Release]
+
+ runs-on: windows-latest # For a list of available runner types, refer to
+ # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
+
+ env:
+ Solution_Name: wpf-material-dialogs.sln # Replace with your solution name, i.e. MyWpfApp.sln.
+ Test_Project_Path: wpf-material-dialogs.test\wpf-material-dialogs.test.csproj # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj.
+ Wap_Project_Directory: src # Replace with the Wap project directory relative to the solution, i.e. MyWpfApp.Package.
+ Wap_Project_Path: src\wpf-material-dialogs.csproj # Replace with the path to your Wap project, i.e. MyWpf.App.Package\MyWpfApp.Package.wapproj.
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+
+ # Install the .NET Core workload
+ - name: Install .NET Core
+ uses: actions/setup-dotnet@v4
+ with:
+ dotnet-version: 8.0.x
+
+ # Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
+ - name: Setup MSBuild.exe
+ uses: microsoft/setup-msbuild@v2
+
+ # Execute all unit tests in the solution
+ - name: Execute unit tests
+ run: dotnet test
\ No newline at end of file
diff --git a/src/wpf-material-dialogs.csproj b/src/wpf-material-dialogs.csproj
index 4687fd1..02c2149 100644
--- a/src/wpf-material-dialogs.csproj
+++ b/src/wpf-material-dialogs.csproj
@@ -1,64 +1,69 @@
-
- net472;net6.0-windows;net7.0-windows
- Material Design WPF Dialogs
- true
- latest
- true
-
-
-
- x64
- false
- 1591
-
-
- 1591
- x64
-
-
- wpf_material_dialogs
- true
- true
- Christopher Winland
- Microsoft Corporation
- https://github.com/cwinland/wpf-material-dialogs
- https://github.com/cwinland/wpf-material-dialogs
- GitHub
- WPF Dialogs Core Framework NET Custom Easy
- Common and customizable dialogs made easier in WPF using MaterialDesignThemes.
- WPF Material Dialogs
-
-
- 1.$([System.DateTime]::Now.ToString("y.MM.ddHH"))
- 1.$([System.DateTime]::Now.ToString("y.MM.ddHH"))
- 2.$([System.DateTime]::Now.ToString("y.MM.ddHH"))
-
-
- $(GenerateNuspecDependsOn);SetPackageVersion
- LICENSE
- Common and customizable dialogs made easier in WPF using MaterialDesignThemes.
- copyright(c) 2021 Christopher Winland
-
-
- x64
- DEBUG;TRACE
-
-
- 1.$([System.DateTime]::Now.ToString("y.MM.ddHH"))
+ net6.0-windows;net8.0-windows
+ Material Design WPF Dialogs
+ true
+ latest
+ true
+ AnyCPU
+ true
-
+
+
+ false
+ 1591
+
+
+ 1591
+
+
+ wpf_material_dialogs
+ true
+ true
+ Christopher Winland
+ Microsoft Corporation
+ https://github.com/cwinland/wpf-material-dialogs
+ https://github.com/cwinland/wpf-material-dialogs
+ GitHub
+ WPF Dialogs Core Framework NET Custom Easy
+ Common and customizable dialogs made easier in WPF using MaterialDesignThemes.
+ WPF Material Dialogs
+
+
+ 1.$([System.DateTime]::Now.ToString("y.MM.ddHH"))
+ 1.$([System.DateTime]::Now.ToString("y.MM.ddHH"))
+ 2.$([System.DateTime]::Now.ToString("y.MM.ddHH"))
+
+
+ $(GenerateNuspecDependsOn);SetPackageVersion
+ LICENSE
+ Common and customizable dialogs made easier in WPF using MaterialDesignThemes.
+ copyright(c) 2021 Christopher Winland
+ README.md
+
+
+ DEBUG;TRACE
+
+
+
+ 1.$([System.DateTime]::Now.ToString("y.MM.ddHH"))
+
+
-
-
-
-
+
+
+
+
+
-
-
- True
-
-
-
+
+
+ True
+
+
+
+ True
+ \
+
+
diff --git a/wpf-material-dialogs.sln b/wpf-material-dialogs.sln
index baf2caf..589975e 100644
--- a/wpf-material-dialogs.sln
+++ b/wpf-material-dialogs.sln
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.31624.102
+# Visual Studio Version 17
+VisualStudioVersion = 17.8.34316.72
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "wpf-material-dialogs", "src\wpf-material-dialogs.csproj", "{DB04B9E7-952D-4F8A-8A9E-31C3D223DA2F}"
EndProject
@@ -9,8 +9,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "wpf-material-dialogs.test",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "wpf-material-wpfTest", "wpf-material-wpfTest\wpf-material-wpfTest.csproj", "{441E0B86-9D05-4A1C-BB12-6C966FF8F890}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "wpf-material-wpftestFramework", "wpf-material-wpftestFramework\wpf-material-wpftestFramework.csproj", "{8183930B-C5AE-4C65-8721-DD9BE6B5D879}"
-EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -29,10 +27,6 @@ Global
{441E0B86-9D05-4A1C-BB12-6C966FF8F890}.Debug|Any CPU.Build.0 = Debug|Any CPU
{441E0B86-9D05-4A1C-BB12-6C966FF8F890}.Release|Any CPU.ActiveCfg = Release|Any CPU
{441E0B86-9D05-4A1C-BB12-6C966FF8F890}.Release|Any CPU.Build.0 = Release|Any CPU
- {8183930B-C5AE-4C65-8721-DD9BE6B5D879}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {8183930B-C5AE-4C65-8721-DD9BE6B5D879}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {8183930B-C5AE-4C65-8721-DD9BE6B5D879}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {8183930B-C5AE-4C65-8721-DD9BE6B5D879}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/wpf-material-dialogs.test/AssemblyInfo.cs b/wpf-material-dialogs.test/AssemblyInfo.cs
new file mode 100644
index 0000000..b8f2c7d
--- /dev/null
+++ b/wpf-material-dialogs.test/AssemblyInfo.cs
@@ -0,0 +1,19 @@
+using System.Runtime.InteropServices;
+using Xunit;
+
+// In SDK-style projects such as this one, several assembly attributes that were historically
+// defined in this file are now automatically added during build and populated with
+// values defined in project properties. For details of which attributes are included
+// and how to customise this process see: https://aka.ms/assembly-info-properties
+
+
+// Setting ComVisible to false makes the types in this assembly not visible to COM
+// components. If you need to access a type in this assembly from COM, set the ComVisible
+// attribute to true on that type.
+
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM.
+
+[assembly: Guid("f0c835b6-35db-4ced-971f-f9e97b0d13b7")]
+[assembly: CollectionBehavior(CollectionBehavior.CollectionPerAssembly, DisableTestParallelization = true)]
\ No newline at end of file
diff --git a/wpf-material-dialogs.test/AvalonUnitTesting/.svn/entries b/wpf-material-dialogs.test/AvalonUnitTesting/.svn/entries
deleted file mode 100644
index 79afee4..0000000
--- a/wpf-material-dialogs.test/AvalonUnitTesting/.svn/entries
+++ /dev/null
@@ -1,103 +0,0 @@
-8
-
-dir
-7
-file:///C:/svn-repos/source%20code/AvalonControlsLibrary/AvalonUnitTesting
-file:///C:/svn-repos/source%20code
-
-
-
-2007-10-24T21:46:58.915000Z
-6
-Marlon
-
-
-svn:special svn:externals svn:needs-lock
-
-
-
-
-
-
-
-
-
-
-
-bbe8d2cd-ae28-aa41-b0c7-d45f4a599f82
-
-AvalonDataBindingTraceTester.cs
-file
-
-
-
-
-2007-10-24T21:15:46.750000Z
-4263149c5c9aff8148f02672d0d53c86
-2007-10-24T21:16:38.370000Z
-4
-Marlon
-
-AvalonActivatorHelper.cs
-file
-
-
-
-
-2007-10-24T18:00:02.846000Z
-65a8351ef48f760ae22014e60b10a818
-2007-10-23T06:55:10.824200Z
-3
-Marlon
-
-STAOperationRunner.cs
-file
-
-
-
-
-2007-10-24T21:14:18.267000Z
-8262c371e550e98e5774452ce7f64bb4
-2007-10-24T21:16:38.370000Z
-4
-Marlon
-
-AvalonTraceListener.cs
-file
-
-
-
-
-2007-10-24T18:00:02.885000Z
-b0e1f3d4f177084c4f51a6c994e82c68
-2007-10-23T06:55:10.824200Z
-3
-Marlon
-
-Properties
-dir
-
-AvalonUnitTesting.csproj
-file
-
-
-
-
-2007-10-24T18:00:02.894000Z
-b02396287995f0ff340e9fb403b7fdee
-2007-10-23T06:55:10.824200Z
-3
-Marlon
-
-AvalonTestRunner.cs
-file
-
-
-
-
-2007-10-24T21:46:30.755000Z
-a00a1838fdcc9856005548bae3647347
-2007-10-24T21:46:58.915000Z
-6
-Marlon
-
diff --git a/wpf-material-dialogs.test/AvalonUnitTesting/.svn/format b/wpf-material-dialogs.test/AvalonUnitTesting/.svn/format
deleted file mode 100644
index 45a4fb7..0000000
--- a/wpf-material-dialogs.test/AvalonUnitTesting/.svn/format
+++ /dev/null
@@ -1 +0,0 @@
-8
diff --git a/wpf-material-dialogs.test/AvalonUnitTesting/.svn/text-base/AvalonActivatorHelper.cs.svn-base b/wpf-material-dialogs.test/AvalonUnitTesting/.svn/text-base/AvalonActivatorHelper.cs.svn-base
deleted file mode 100644
index f98c39b..0000000
--- a/wpf-material-dialogs.test/AvalonUnitTesting/.svn/text-base/AvalonActivatorHelper.cs.svn-base
+++ /dev/null
@@ -1,65 +0,0 @@
-using System;
-using System.Windows;
-
-namespace AvalonUnitTesting
-{
- ///
- /// Helper class that creates the instances of the objects
- ///
- internal static class AvalonActivatorHelper
- {
- ///
- /// wrapps a control in a window so that it can be unit tested
- ///
- private class ControlWrapper : Window
- {
- ///
- /// constructor to wrap a control inside a window
- ///
- /// The control to wrap in the window
- public ControlWrapper(object controlToWrap)
- {
- Content = controlToWrap;
- }
- }
-
- ///
- /// Creates the instance of the Type that is passed
- ///
- /// The type to cretae instance of
- /// The constructor parameters if any
- /// An object of the specified type. if the object is not a window it will be wrapped in a window
- /// The type parameter is passed as null
- internal static Window CreateInstance(Type type, params object[] parameters)
- {
- if (type == null)
- throw new ArgumentNullException("type", "Type was passed as null");
-
- object instance;
- if (parameters != null && parameters.Length != 0)
- instance = Activator.CreateInstance(type, parameters);
- else
- instance = Activator.CreateInstance(type);
-
- return VerifyObjectType(instance);
- }
-
- ///
- /// Checks if the object is of type window
- /// If not it creates a wrapper window
- ///
- /// The instance of the object to check
- /// Returns a window instance
- public static Window VerifyObjectType(object instance)
- {
- Window returnValue = instance as Window;
- //return the value if it is alread a window
- if (returnValue != null)
- return returnValue;
-
- //wrap the control in a window and return it
- ControlWrapper wrapper = new ControlWrapper(instance);
- return wrapper;
- }
- }
-}
diff --git a/wpf-material-dialogs.test/AvalonUnitTesting/.svn/text-base/AvalonDataBindingTraceTester.cs.svn-base b/wpf-material-dialogs.test/AvalonUnitTesting/.svn/text-base/AvalonDataBindingTraceTester.cs.svn-base
deleted file mode 100644
index ddfb626..0000000
--- a/wpf-material-dialogs.test/AvalonUnitTesting/.svn/text-base/AvalonDataBindingTraceTester.cs.svn-base
+++ /dev/null
@@ -1,52 +0,0 @@
-using System.Diagnostics;
-using System.Windows;
-
-namespace AvalonUnitTesting
-{
- ///
- /// Hooks to the Trace of the WPF databinding to check for dat binding errors
- ///
- public static class AvalonDataBindingTraceTester
- {
- private static AvalonTraceListener dataBindingListener;
-
- ///
- /// Gets a databinding trace listener
- ///
- internal static AvalonTraceListener DataBindingListener
- {
- get
- {
- if (dataBindingListener == null)
- dataBindingListener = new AvalonTraceListener();
- return dataBindingListener;
- }
- }
-
- ///
- /// hooks the window to the wpf trace
- ///
- /// The window to test
- public static void TestDataBindingsForObject(Window windowToTest)
- {
- EnforceDataBindingTraceListener(windowToTest);
- windowToTest.ShowInTaskbar = false;
- windowToTest.Show();
- windowToTest.Hide();
- }
-
- //check if there is already a databinding trace listener, if not creates it
- private static void EnforceDataBindingTraceListener(Window currentWindow)
- {
- PresentationTraceSources.Refresh();
- PresentationTraceSources.DataBindingSource.Switch.Level = SourceLevels.Warning;
-
- //add the databinding listener
- if (!PresentationTraceSources.DataBindingSource.Listeners.Contains(DataBindingListener))
- PresentationTraceSources.DataBindingSource.Listeners.Add(DataBindingListener);
-
- //set the current window being tested
- DataBindingListener.CurrentWindowBeingTested = currentWindow;
- }
- }
-}
diff --git a/wpf-material-dialogs.test/AvalonUnitTesting/.svn/text-base/AvalonTestRunner.cs.svn-base b/wpf-material-dialogs.test/AvalonUnitTesting/.svn/text-base/AvalonTestRunner.cs.svn-base
deleted file mode 100644
index 97440c4..0000000
--- a/wpf-material-dialogs.test/AvalonUnitTesting/.svn/text-base/AvalonTestRunner.cs.svn-base
+++ /dev/null
@@ -1,35 +0,0 @@
-using System.Threading;
-using System.Windows;
-
-namespace AvalonUnitTesting
-{
- ///
- /// base class for unit test of wpf
- ///
- public class AvalonTestRunner
- {
- ///
- /// Runs a set of tests for data binding
- ///
- ///
- public static void RunDataBindingTests(object objectToTest)
- {
- //get the window instance. This will create a wrapper window if a window is not passes as parameter
- Window windowToTest = AvalonActivatorHelper.VerifyObjectType(objectToTest);
- if (windowToTest != null)
- AvalonDataBindingTraceTester.TestDataBindingsForObject(windowToTest);
-
- }
-
- private static readonly STAOperationRunner runner = new STAOperationRunner();
-
- ///
- /// Runs a delegate in a STA thread
- ///
- /// The operation to run
- public static void RunInSTA(ThreadStart userDelegate)
- {
- runner.RunInSTA(userDelegate);
- }
- }
-}
diff --git a/wpf-material-dialogs.test/AvalonUnitTesting/.svn/text-base/AvalonTraceListener.cs.svn-base b/wpf-material-dialogs.test/AvalonUnitTesting/.svn/text-base/AvalonTraceListener.cs.svn-base
deleted file mode 100644
index 8f80904..0000000
--- a/wpf-material-dialogs.test/AvalonUnitTesting/.svn/text-base/AvalonTraceListener.cs.svn-base
+++ /dev/null
@@ -1,42 +0,0 @@
-using System.Diagnostics;
-using System.Windows;
-using NUnit.Framework;
-
-namespace AvalonUnitTesting
-{
- ///
- /// Trace listener that asserts when a data binding error is encontered in a specific page
- ///
- public class AvalonTraceListener : TraceListener
- {
- private Window currentWindowBeingTested;
-
- ///
- /// The current window that is being tests
- ///
- internal Window CurrentWindowBeingTested
- {
- get { return currentWindowBeingTested; }
- set { currentWindowBeingTested = value; }
- }
- ///
- /// Fails the unit test if this method is called
- ///
- /// The message to push in the fail
- public override void Write(string message)
- { }
-
- ///
- /// Fails the unit test if this method is called
- ///
- /// The message to push in the fail
- public override void WriteLine(string message)
- {
- //close the window before failing the tests
- if (currentWindowBeingTested != null)
- currentWindowBeingTested.Close();
-
- Assert.Fail(message);
- }
- }
-}
diff --git a/wpf-material-dialogs.test/AvalonUnitTesting/.svn/text-base/AvalonUnitTesting.csproj.svn-base b/wpf-material-dialogs.test/AvalonUnitTesting/.svn/text-base/AvalonUnitTesting.csproj.svn-base
deleted file mode 100644
index 1550165..0000000
--- a/wpf-material-dialogs.test/AvalonUnitTesting/.svn/text-base/AvalonUnitTesting.csproj.svn-base
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-
- Debug
- AnyCPU
- 8.0.50727
- 2.0
- {0071B386-1F4D-45D4-9D1B-4B11385B5E1C}
- library
- Properties
- AvalonUnitTesting
- AvalonUnitTesting
- v3.0
- 512
- {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- 4
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
- False
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Code
-
-
- True
- True
- Resources.resx
-
-
- True
- Settings.settings
- True
-
-
-
- ResXFileCodeGenerator
- Resources.Designer.cs
- Designer
-
-
- SettingsSingleFileGenerator
- Settings.Designer.cs
-
-
-
-
-
-
\ No newline at end of file
diff --git a/wpf-material-dialogs.test/AvalonUnitTesting/.svn/text-base/STAOperationRunner.cs.svn-base b/wpf-material-dialogs.test/AvalonUnitTesting/.svn/text-base/STAOperationRunner.cs.svn-base
deleted file mode 100644
index 62d9120..0000000
--- a/wpf-material-dialogs.test/AvalonUnitTesting/.svn/text-base/STAOperationRunner.cs.svn-base
+++ /dev/null
@@ -1,67 +0,0 @@
-using System;
-using System.Reflection;
-using System.Security.Permissions;
-using System.Threading;
-
-namespace AvalonUnitTesting
-{
- ///
- /// Runs a specific job in a specific thread apartment
- ///
- public class STAOperationRunner
- {
- private Exception lastException;
-
- ///
- /// Runs a specific method in Single Threaded apartment
- ///
- /// A delegate to run
- public void RunInSTA(ThreadStart userDelegate)
- {
- if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA)
- Run(userDelegate, ApartmentState.STA);
- else
- userDelegate.Invoke();
- }
-
- private void Run(ThreadStart userDelegate, ApartmentState apartmentState)
- {
- lastException = null;
-
- Thread thread = new Thread(
- delegate()
- {
- try
- {
- userDelegate.Invoke();
- }
- catch (Exception e)
- {
- lastException = e;
- }
- });
- thread.SetApartmentState(apartmentState);
-
- thread.Start();
- thread.Join();
-
- if (ExceptionWasThrown())
- ThrowExceptionPreservingStack(lastException);
- }
-
- private bool ExceptionWasThrown()
- {
- return lastException != null;
- }
-
- [ReflectionPermission(SecurityAction.Demand)]
- private static void ThrowExceptionPreservingStack(Exception exception)
- {
- FieldInfo remoteStackTraceString = typeof(Exception).GetField(
- "_remoteStackTraceString",
- BindingFlags.Instance | BindingFlags.NonPublic);
- remoteStackTraceString.SetValue(exception, exception.StackTrace + Environment.NewLine);
- throw exception;
- }
- }
-}
diff --git a/wpf-material-dialogs.test/AvalonUnitTesting/AvalonActivatorHelper.cs b/wpf-material-dialogs.test/AvalonUnitTesting/AvalonActivatorHelper.cs
deleted file mode 100644
index cabd695..0000000
--- a/wpf-material-dialogs.test/AvalonUnitTesting/AvalonActivatorHelper.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-using System;
-using System.Windows;
-
-namespace wpf_material_dialogs.test.AvalonUnitTesting
-{
- ///
- /// Helper class that creates the instances of the objects
- ///
- internal static class AvalonActivatorHelper
- {
- ///
- /// wrapps a control in a window so that it can be unit tested
- ///
- private class ControlWrapper : Window
- {
- ///
- /// constructor to wrap a control inside a window
- ///
- /// The control to wrap in the window
- public ControlWrapper(object controlToWrap)
- {
- Content = controlToWrap;
- }
- }
-
- ///
- /// Creates the instance of the Type that is passed
- ///
- /// The type to cretae instance of
- /// The constructor parameters if any
- /// An object of the specified type. if the object is not a window it will be wrapped in a window
- /// The type parameter is passed as null
- internal static Window CreateInstance(Type type, params object[] parameters)
- {
- if (type == null)
- throw new ArgumentNullException("type", "Type was passed as null");
-
- object instance;
- if (parameters != null && parameters.Length != 0)
- instance = Activator.CreateInstance(type, parameters);
- else
- instance = Activator.CreateInstance(type);
-
- return VerifyObjectType(instance);
- }
-
- ///
- /// Checks if the object is of type window
- /// If not it creates a wrapper window
- ///
- /// The instance of the object to check
- /// Returns a window instance
- public static Window VerifyObjectType(object instance)
- {
- var returnValue = instance as Window;
-
- //return the value if it is alread a window
- if (returnValue != null)
- return returnValue;
-
- //wrap the control in a window and return it
- var wrapper = new ControlWrapper(instance);
-
- return wrapper;
- }
- }
-}
diff --git a/wpf-material-dialogs.test/AvalonUnitTesting/AvalonDataBindingTraceTester.cs b/wpf-material-dialogs.test/AvalonUnitTesting/AvalonDataBindingTraceTester.cs
deleted file mode 100644
index 0db065b..0000000
--- a/wpf-material-dialogs.test/AvalonUnitTesting/AvalonDataBindingTraceTester.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-using System.Diagnostics;
-using System.Windows;
-
-namespace wpf_material_dialogs.test.AvalonUnitTesting
-{
- ///
- /// Hooks to the Trace of the WPF databinding to check for dat binding errors
- ///
- public static class AvalonDataBindingTraceTester
- {
- private static AvalonTraceListener dataBindingListener;
-
- ///
- /// Gets a databinding trace listener
- ///
- internal static AvalonTraceListener DataBindingListener
- {
- get
- {
- if (dataBindingListener == null)
- dataBindingListener = new AvalonTraceListener();
- return dataBindingListener;
- }
- }
-
- ///
- /// hooks the window to the wpf trace
- ///
- /// The window to test
- public static void TestDataBindingsForObject(Window windowToTest)
- {
- EnforceDataBindingTraceListener(windowToTest);
- windowToTest.ShowInTaskbar = false;
- windowToTest.Show();
- windowToTest.Hide();
- }
-
- //check if there is already a databinding trace listener, if not creates it
- private static void EnforceDataBindingTraceListener(Window currentWindow)
- {
- PresentationTraceSources.Refresh();
- PresentationTraceSources.DataBindingSource.Switch.Level = SourceLevels.Warning;
-
- //add the databinding listener
- if (!PresentationTraceSources.DataBindingSource.Listeners.Contains(DataBindingListener))
- PresentationTraceSources.DataBindingSource.Listeners.Add(DataBindingListener);
-
- //set the current window being tested
- DataBindingListener.CurrentWindowBeingTested = currentWindow;
- }
- }
-}
diff --git a/wpf-material-dialogs.test/AvalonUnitTesting/AvalonTestRunner.cs b/wpf-material-dialogs.test/AvalonUnitTesting/AvalonTestRunner.cs
deleted file mode 100644
index 663b09e..0000000
--- a/wpf-material-dialogs.test/AvalonUnitTesting/AvalonTestRunner.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-using System.Threading;
-
-namespace wpf_material_dialogs.test.AvalonUnitTesting
-{
- ///
- /// base class for unit test of wpf
- ///
- public class AvalonTestRunner
- {
- ///
- /// Runs a set of tests for data binding
- ///
- ///
- public static void RunDataBindingTests(object objectToTest)
- {
- //get the window instance. This will create a wrapper window if a window is not passes as parameter
- var windowToTest = AvalonActivatorHelper.VerifyObjectType(objectToTest);
- if (windowToTest != null)
- AvalonDataBindingTraceTester.TestDataBindingsForObject(windowToTest);
- }
-
- private static readonly STAOperationRunner runner = new();
-
- ///
- /// Runs a delegate in a STA thread
- ///
- /// The operation to run
- public static void RunInSTA(ThreadStart userDelegate)
- {
- runner.RunInSTA(userDelegate);
- }
- }
-}
diff --git a/wpf-material-dialogs.test/AvalonUnitTesting/AvalonTraceListener.cs b/wpf-material-dialogs.test/AvalonUnitTesting/AvalonTraceListener.cs
deleted file mode 100644
index 0a909e7..0000000
--- a/wpf-material-dialogs.test/AvalonUnitTesting/AvalonTraceListener.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-using NUnit.Framework;
-using System.Diagnostics;
-using System.Windows;
-
-namespace wpf_material_dialogs.test.AvalonUnitTesting
-{
- ///
- /// Trace listener that asserts when a data binding error is encontered in a specific page
- ///
- public class AvalonTraceListener : TraceListener
- {
- private Window currentWindowBeingTested;
-
- ///
- /// The current window that is being tests
- ///
- internal Window CurrentWindowBeingTested
- {
- get { return currentWindowBeingTested; }
- set { currentWindowBeingTested = value; }
- }
- ///
- /// Fails the unit test if this method is called
- ///
- /// The message to push in the fail
- public override void Write(string message)
- { }
-
- ///
- /// Fails the unit test if this method is called
- ///
- /// The message to push in the fail
- public override void WriteLine(string message)
- {
- //close the window before failing the tests
- if (currentWindowBeingTested != null)
- currentWindowBeingTested.Close();
-
- Assert.Fail(message);
- }
- }
-}
diff --git a/wpf-material-dialogs.test/AvalonUnitTesting/AvalonUnitTesting.csproj b/wpf-material-dialogs.test/AvalonUnitTesting/AvalonUnitTesting.csproj
deleted file mode 100644
index 1550165..0000000
--- a/wpf-material-dialogs.test/AvalonUnitTesting/AvalonUnitTesting.csproj
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-
- Debug
- AnyCPU
- 8.0.50727
- 2.0
- {0071B386-1F4D-45D4-9D1B-4B11385B5E1C}
- library
- Properties
- AvalonUnitTesting
- AvalonUnitTesting
- v3.0
- 512
- {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- 4
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
- False
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Code
-
-
- True
- True
- Resources.resx
-
-
- True
- Settings.settings
- True
-
-
-
- ResXFileCodeGenerator
- Resources.Designer.cs
- Designer
-
-
- SettingsSingleFileGenerator
- Settings.Designer.cs
-
-
-
-
-
-
\ No newline at end of file
diff --git a/wpf-material-dialogs.test/AvalonUnitTesting/Properties/.svn/entries b/wpf-material-dialogs.test/AvalonUnitTesting/Properties/.svn/entries
deleted file mode 100644
index e205272..0000000
--- a/wpf-material-dialogs.test/AvalonUnitTesting/Properties/.svn/entries
+++ /dev/null
@@ -1,76 +0,0 @@
-8
-
-dir
-7
-file:///C:/svn-repos/source%20code/AvalonControlsLibrary/AvalonUnitTesting/Properties
-file:///C:/svn-repos/source%20code
-
-
-
-2007-10-21T12:42:48.069000Z
-2
-Marlon
-
-
-svn:special svn:externals svn:needs-lock
-
-AssemblyInfo.cs
-file
-
-
-
-
-2007-10-11T21:33:50.587000Z
-07ea9c7721e0f83a592720298df780ee
-2007-10-21T12:42:48.069000Z
-2
-Marlon
-
-Settings.settings
-file
-
-
-
-
-2007-10-11T21:33:50.517000Z
-af5b91869ef1266c0a33c882a311cd20
-2007-10-21T12:42:48.069000Z
-2
-Marlon
-
-Settings.Designer.cs
-file
-
-
-
-
-2007-10-11T21:33:50.728000Z
-30bd36bdcb3420c1ae6a81f47aa7ab2b
-2007-10-21T12:42:48.069000Z
-2
-Marlon
-
-Resources.resx
-file
-
-
-
-
-2007-10-11T21:33:50.605000Z
-0cd8c971317d19bbed44757809bcb92b
-2007-10-21T12:42:48.069000Z
-2
-Marlon
-
-Resources.Designer.cs
-file
-
-
-
-
-2007-10-11T21:33:50.692000Z
-64a5728fbcb3ceec68e9032da0dfc3fa
-2007-10-21T12:42:48.069000Z
-2
-Marlon
-
diff --git a/wpf-material-dialogs.test/AvalonUnitTesting/Properties/.svn/format b/wpf-material-dialogs.test/AvalonUnitTesting/Properties/.svn/format
deleted file mode 100644
index 45a4fb7..0000000
--- a/wpf-material-dialogs.test/AvalonUnitTesting/Properties/.svn/format
+++ /dev/null
@@ -1 +0,0 @@
-8
diff --git a/wpf-material-dialogs.test/AvalonUnitTesting/Properties/.svn/text-base/AssemblyInfo.cs.svn-base b/wpf-material-dialogs.test/AvalonUnitTesting/Properties/.svn/text-base/AssemblyInfo.cs.svn-base
deleted file mode 100644
index ef8036c..0000000
--- a/wpf-material-dialogs.test/AvalonUnitTesting/Properties/.svn/text-base/AssemblyInfo.cs.svn-base
+++ /dev/null
@@ -1,55 +0,0 @@
-using System.Reflection;
-using System.Resources;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using System.Windows;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("AvalonUnitTesting")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("AvalonUnitTesting")]
-[assembly: AssemblyCopyright("Copyright © 2007")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-//In order to begin building localizable applications, set
-//CultureYouAreCodingWith in your .csproj file
-//inside a . For example, if you are using US english
-//in your source files, set the to en-US. Then uncomment
-//the NeutralResourceLanguage attribute below. Update the "en-US" in
-//the line below to match the UICulture setting in the project file.
-
-//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
-
-
-[assembly: ThemeInfo(
- ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
- //(used if a resource is not found in the page,
- // or application resource dictionaries)
- ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
- //(used if a resource is not found in the page,
- // app, or any theme specific resource dictionaries)
-)]
-
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/wpf-material-dialogs.test/AvalonUnitTesting/Properties/.svn/text-base/Resources.Designer.cs.svn-base b/wpf-material-dialogs.test/AvalonUnitTesting/Properties/.svn/text-base/Resources.Designer.cs.svn-base
deleted file mode 100644
index 5fadfcc..0000000
--- a/wpf-material-dialogs.test/AvalonUnitTesting/Properties/.svn/text-base/Resources.Designer.cs.svn-base
+++ /dev/null
@@ -1,71 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:2.0.50727.1378
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace AvalonUnitTesting.Properties
-{
-
-
- ///
- /// A strongly-typed resource class, for looking up localized strings, etc.
- ///
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class Resources
- {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal Resources()
- {
- }
-
- ///
- /// Returns the cached ResourceManager instance used by this class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager
- {
- get
- {
- if ((resourceMan == null))
- {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AvalonUnitTesting.Properties.Resources", typeof(Resources).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- ///
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture
- {
- get
- {
- return resourceCulture;
- }
- set
- {
- resourceCulture = value;
- }
- }
- }
-}
diff --git a/wpf-material-dialogs.test/AvalonUnitTesting/Properties/.svn/text-base/Resources.resx.svn-base b/wpf-material-dialogs.test/AvalonUnitTesting/Properties/.svn/text-base/Resources.resx.svn-base
deleted file mode 100644
index af7dbeb..0000000
--- a/wpf-material-dialogs.test/AvalonUnitTesting/Properties/.svn/text-base/Resources.resx.svn-base
+++ /dev/null
@@ -1,117 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
\ No newline at end of file
diff --git a/wpf-material-dialogs.test/AvalonUnitTesting/Properties/.svn/text-base/Settings.Designer.cs.svn-base b/wpf-material-dialogs.test/AvalonUnitTesting/Properties/.svn/text-base/Settings.Designer.cs.svn-base
deleted file mode 100644
index 0a89a5d..0000000
--- a/wpf-material-dialogs.test/AvalonUnitTesting/Properties/.svn/text-base/Settings.Designer.cs.svn-base
+++ /dev/null
@@ -1,30 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:2.0.50727.1378
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace AvalonUnitTesting.Properties
-{
-
-
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
- internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
- {
-
- private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
- public static Settings Default
- {
- get
- {
- return defaultInstance;
- }
- }
- }
-}
diff --git a/wpf-material-dialogs.test/AvalonUnitTesting/Properties/.svn/text-base/Settings.settings.svn-base b/wpf-material-dialogs.test/AvalonUnitTesting/Properties/.svn/text-base/Settings.settings.svn-base
deleted file mode 100644
index 033d7a5..0000000
--- a/wpf-material-dialogs.test/AvalonUnitTesting/Properties/.svn/text-base/Settings.settings.svn-base
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/wpf-material-dialogs.test/AvalonUnitTesting/Properties/Resources.Designer.cs b/wpf-material-dialogs.test/AvalonUnitTesting/Properties/Resources.Designer.cs
deleted file mode 100644
index 5fadfcc..0000000
--- a/wpf-material-dialogs.test/AvalonUnitTesting/Properties/Resources.Designer.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:2.0.50727.1378
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace AvalonUnitTesting.Properties
-{
-
-
- ///
- /// A strongly-typed resource class, for looking up localized strings, etc.
- ///
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class Resources
- {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal Resources()
- {
- }
-
- ///
- /// Returns the cached ResourceManager instance used by this class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager
- {
- get
- {
- if ((resourceMan == null))
- {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AvalonUnitTesting.Properties.Resources", typeof(Resources).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- ///
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture
- {
- get
- {
- return resourceCulture;
- }
- set
- {
- resourceCulture = value;
- }
- }
- }
-}
diff --git a/wpf-material-dialogs.test/AvalonUnitTesting/Properties/Resources.resx b/wpf-material-dialogs.test/AvalonUnitTesting/Properties/Resources.resx
deleted file mode 100644
index af7dbeb..0000000
--- a/wpf-material-dialogs.test/AvalonUnitTesting/Properties/Resources.resx
+++ /dev/null
@@ -1,117 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
\ No newline at end of file
diff --git a/wpf-material-dialogs.test/AvalonUnitTesting/Properties/Settings.Designer.cs b/wpf-material-dialogs.test/AvalonUnitTesting/Properties/Settings.Designer.cs
deleted file mode 100644
index 0a89a5d..0000000
--- a/wpf-material-dialogs.test/AvalonUnitTesting/Properties/Settings.Designer.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:2.0.50727.1378
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace AvalonUnitTesting.Properties
-{
-
-
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
- internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
- {
-
- private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
- public static Settings Default
- {
- get
- {
- return defaultInstance;
- }
- }
- }
-}
diff --git a/wpf-material-dialogs.test/AvalonUnitTesting/Properties/Settings.settings b/wpf-material-dialogs.test/AvalonUnitTesting/Properties/Settings.settings
deleted file mode 100644
index 033d7a5..0000000
--- a/wpf-material-dialogs.test/AvalonUnitTesting/Properties/Settings.settings
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/wpf-material-dialogs.test/AvalonUnitTesting/STAOperationRunner.cs b/wpf-material-dialogs.test/AvalonUnitTesting/STAOperationRunner.cs
deleted file mode 100644
index 22a2ffd..0000000
--- a/wpf-material-dialogs.test/AvalonUnitTesting/STAOperationRunner.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-using System;
-using System.Reflection;
-using System.Threading;
-
-namespace wpf_material_dialogs.test.AvalonUnitTesting
-{
- ///
- /// Runs a specific job in a specific thread apartment
- ///
- public class STAOperationRunner
- {
- private Exception lastException;
-
- ///
- /// Runs a specific method in Single Threaded apartment
- ///
- /// A delegate to run
- public void RunInSTA(ThreadStart userDelegate)
- {
- if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA)
- Run(userDelegate, ApartmentState.STA);
- else
- userDelegate.Invoke();
- }
-
- private void Run(ThreadStart userDelegate, ApartmentState apartmentState)
- {
- lastException = null;
-
- var thread = new Thread(delegate()
- {
- try
- {
- userDelegate.Invoke();
- }
- catch (Exception e)
- {
- lastException = e;
- }
- });
- thread.SetApartmentState(apartmentState);
-
- thread.Start();
- thread.Join();
-
- if (ExceptionWasThrown())
- ThrowExceptionPreservingStack(lastException);
- }
-
- private bool ExceptionWasThrown()
- {
- return lastException != null;
- }
-
- private static void ThrowExceptionPreservingStack(Exception exception)
- {
- var remoteStackTraceString = typeof(Exception).GetField("_remoteStackTraceString",
- BindingFlags.Instance | BindingFlags.NonPublic);
- remoteStackTraceString?.SetValue(exception, exception.StackTrace + Environment.NewLine);
-
- throw exception;
- }
- }
-}
diff --git a/wpf-material-dialogs.test/DialogTests.cs b/wpf-material-dialogs.test/DialogTests.cs
index cc61f0b..9efcb58 100644
--- a/wpf-material-dialogs.test/DialogTests.cs
+++ b/wpf-material-dialogs.test/DialogTests.cs
@@ -1,6 +1,5 @@
using FluentAssertions;
using MaterialDesignThemes.Wpf;
-using NUnit.Framework;
using System;
using System.Reflection;
using System.Threading;
@@ -11,16 +10,19 @@
using wpf_material_dialogs.Dialogs;
using wpf_material_dialogs.Enums;
using wpf_material_dialogs.Interfaces;
+using Xunit;
namespace wpf_material_dialogs.test
{
- [NUnit.Framework.Ignore("base class")]
- internal class DialogTestBase : IDisposable where TDialog : IDialog, new()
+ [Collection("tests")]
+ [CollectionDefinition("test", DisableParallelization = true)]
+ public abstract class DialogTestBase : IDisposable where TDialog : IDialog, new()
{
private DialogHost dialogHost;
private IDialog testDialog;
- [SetUp]
+ protected DialogTestBase() => SetupTests();
+
public void SetupTests()
{
var mi = typeof(DialogHost).GetMethod("GetInstance", BindingFlags.NonPublic | BindingFlags.Static);
@@ -34,7 +36,7 @@ public void SetupTests()
}
dialogHost ??= new DialogHost();
- dialogHost?.RaiseEvent(new RoutedEventArgs(FrameworkElement.LoadedEvent));
+ dialogHost.RaiseEvent(new RoutedEventArgs(FrameworkElement.LoadedEvent));
//_dialogHost.Identifier = hostId;
testDialog = new TDialog
{
@@ -49,7 +51,7 @@ public void SetupTests()
public void Dispose() => dialogHost?.RaiseEvent(new RoutedEventArgs(FrameworkElement.UnloadedEvent));
- [Test]
+ [StaFact]
public void CanOpenAndCloseDialogWithShowDialogIsOpen()
{
dialogHost.IsOpen = false;
@@ -63,7 +65,7 @@ public void CanOpenAndCloseDialogWithShowDialogIsOpen()
session?.IsEnded.Should().BeTrue();
}
- [Test]
+ [StaFact]
public async Task CanOpenAndCloseDialogWithShowMethodDialogResult()
{
var id = Guid.NewGuid();
@@ -75,7 +77,7 @@ public async Task CanOpenAndCloseDialogWithShowMethodDialogResult()
dialogHost.IsOpen.Should().BeFalse();
}
- [Test]
+ [StaFact]
public async Task CanOpenAndCloseDialogWithShowMethodAnyObject()
{
var result = await OpenTestDialogObject(testDialog, (sender, args) => args.Session.Close(42));
@@ -84,7 +86,7 @@ public async Task CanOpenAndCloseDialogWithShowMethodAnyObject()
dialogHost.IsOpen.Should().BeFalse();
}
- [Test]
+ [StaFact]
public async Task CanOpenDialogWithShowMethodAndCloseWithIsOpen()
{
var result = await OpenTestDialogObject(testDialog, (sender, args) => dialogHost.IsOpen = false);
@@ -93,7 +95,7 @@ public async Task CanOpenDialogWithShowMethodAndCloseWithIsOpen()
dialogHost.IsOpen.Should().BeFalse();
}
- [Test]
+ [StaFact]
public async Task CanCloseDialogWithRoutedEvent()
{
var closeParameter = Guid.NewGuid();
@@ -103,15 +105,15 @@ public async Task CanCloseDialogWithRoutedEvent()
Assert.False(session?.IsEnded ?? false);
DialogHost.CloseDialogCommand.Execute(closeParameter, dialogHost);
- Thread.Sleep(200);
+ Thread.Yield();
Assert.False(dialogHost.IsOpen);
Assert.Null(dialogHost.CurrentSession);
Assert.True(session?.IsEnded ?? false);
Task.WaitAll(showTask);
- Assert.AreEqual(closeParameter, await showTask);
+ Assert.Equivalent(closeParameter, await showTask);
}
- [Test]
+ [StaFact]
public async Task DialogHostExposesSessionAsProperty() =>
await OpenTestDialogObject(testDialog,
(sender, args) =>
@@ -120,7 +122,7 @@ await OpenTestDialogObject(testDialog,
args.Session.Close();
});
- [Test]
+ [StaFact]
public async Task WhenNoIdentifierIsSpecifiedItUsesSingleDialogHost()
{
var isOpen = false;
@@ -133,7 +135,7 @@ await OpenTestDialogObject(testDialog,
isOpen.Should().BeTrue();
}
- [Test]
+ [StaFact]
public async Task WhenContentIsUpdatedClosingEventHandlerIsInvoked()
{
var closeInvokeCount = 0;
@@ -153,15 +155,15 @@ void ClosingHandler(object s, DialogClosingEventArgs e)
dialogHost.CurrentSession?.Close("SecondResult");
var result = await dialogTask;
- Assert.AreEqual("SecondResult", result);
- Assert.AreEqual(2, closeInvokeCount);
+ Assert.Equivalent("SecondResult", result);
+ Assert.Equivalent(2, closeInvokeCount);
}
- [Test]
+ [StaFact]
public void WhenOpenDialogsAreOpenIsExist()
{
var isExist = false;
- OpenTestDialogObject(testDialog, (sender, arg) => isExist = DialogHost.IsDialogOpen(dialogHost.Identifier));
+ _ = OpenTestDialogObject(testDialog, (sender, arg) => isExist = DialogHost.IsDialogOpen(dialogHost.Identifier));
Assert.True(isExist);
DialogHost.Close(dialogHost.Identifier);
Assert.False(DialogHost.IsDialogOpen(dialogHost.Identifier));
@@ -183,23 +185,19 @@ private async Task OpenTestDialog(IDialog dialog, DialogOpenedEven
}
}
- [Apartment(ApartmentState.STA)]
- internal class AlertDialogTests : DialogTestBase
+ public class AlertDialogTests : DialogTestBase
{
}
- [Apartment(ApartmentState.STA)]
- internal class ErrorDialogTests : DialogTestBase
+ public class ErrorDialogTests : DialogTestBase
{
}
- [Apartment(ApartmentState.STA)]
- internal class InfoDialogTests : DialogTestBase
+ public class InfoDialogTests : DialogTestBase
{
}
- [Apartment(ApartmentState.STA)]
- internal class WarningDialogTests : DialogTestBase
+ public class WarningDialogTests : DialogTestBase
{
}
}
diff --git a/wpf-material-dialogs.test/wpf-material-dialogs.test.csproj b/wpf-material-dialogs.test/wpf-material-dialogs.test.csproj
index 31bcd74..f5dd8a5 100644
--- a/wpf-material-dialogs.test/wpf-material-dialogs.test.csproj
+++ b/wpf-material-dialogs.test/wpf-material-dialogs.test.csproj
@@ -1,29 +1,42 @@
-
- net7.0-windows
- wpf_material_dialogs.test
+
+ net6.0-windows;net8.0-windows
+ wpf_material_dialogs.test
+ AnyCPU
+ true
+ latest
+ false
+ true
+ true
+
- false
-
+
+ DEBUG;TRACE
+
-
- x64
- DEBUG;TRACE
-
+
+
+
+
+
+
+ all
+ runtime; build; native; contentfiles; buildtransitive
+ analyzers
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
-
-
-
-
-
-
- all
- runtime; build; native; contentfiles; analyzers; buildtransitive
-
-
+
+
+
-
-
-
+
+
+
diff --git a/wpf-material-wpfTest/TestCustomDialog.xaml b/wpf-material-wpfTest/TestCustomDialog.xaml
index f21189a..12c1265 100644
--- a/wpf-material-wpfTest/TestCustomDialog.xaml
+++ b/wpf-material-wpfTest/TestCustomDialog.xaml
@@ -6,13 +6,14 @@
xmlns:forms="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:wpfMaterialDialogs="clr-namespace:wpf_material_dialogs;assembly=wpf-material-dialogs"
+ xmlns:wpfMaterialWpfTest="clr-namespace:wpf_material_wpfTest"
mc:Ignorable="d"
Height="Auto" Width="500"
d:DesignHeight="450" d:DesignWidth="500">
diff --git a/wpf-material-wpfTest/wpf-material-wpfTest.csproj b/wpf-material-wpfTest/wpf-material-wpfTest.csproj
index a951c12..d56b0c5 100644
--- a/wpf-material-wpfTest/wpf-material-wpfTest.csproj
+++ b/wpf-material-wpfTest/wpf-material-wpfTest.csproj
@@ -1,31 +1,30 @@
-
- WinExe
- net7.0-windows
- wpf_material_wpfTest
- true
- true
-
+
+ WinExe
+ net6.0-windows;net8.0-windows
+ wpf_material_wpfTest
+ true
+ latest
+ true
+ AnyCPU
+ false
+ false
+ true
+
-
- x64
- DEBUG;TRACE
- 4
-
+
+ DEBUG;TRACE
+ 4
+
-
-
-
-
-
- all
- runtime; build; native; contentfiles; analyzers; buildtransitive
-
-
+
+
+
+
-
-
-
+
+
+
diff --git a/wpf-material-wpftestFramework/wpf-material-wpftestFramework.csproj b/wpf-material-wpftestFramework/wpf-material-wpftestFramework.csproj
index 21c809b..c6ca757 100644
--- a/wpf-material-wpftestFramework/wpf-material-wpftestFramework.csproj
+++ b/wpf-material-wpftestFramework/wpf-material-wpftestFramework.csproj
@@ -18,7 +18,7 @@
- x64
+ AnyCPU
true
full
false