diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index accc46bb..4294bbc9 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -9,36 +9,35 @@ on:
jobs:
- windows:
- name: Windows
- runs-on: windows-latest
+ build:
+ strategy:
+ fail-fast: false
+ matrix:
+ platform:
+ - name: Windows
+ os: windows-latest
+ - name: macOS
+ os: macos-14
+ configuration:
+ - Debug
+ - Release
+ # Tries to AOT the test infrastructure assemblies which is not supported
+ exclude:
+ - platform:
+ name: macOS
+ configuration: Release
+ name: ${{ matrix.platform.name }} (${{ matrix.configuration }})
+ runs-on: ${{ matrix.platform.os }}
steps:
- name: Checkout
- uses: actions/checkout@v2
+ uses: actions/checkout@v4
- name: Setup Required Tools
uses: ./.github/workflows/setup-tools
- name: Build
- run: dotnet build DeviceRunners.sln --configuration Release /bl:./artifacts/logs/msbuild-build.binlog
+ run: dotnet build DeviceRunners.sln --configuration ${{ matrix.configuration }} /bl:./artifacts/logs/msbuild-build.binlog
- name: Upload Logs
- uses: actions/upload-artifact@v1
+ uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
- name: Logs - Windows
- path: ./artifacts/logs
-
- macos:
- name: macOS
- runs-on: macos-14
- steps:
- - name: Checkout
- uses: actions/checkout@v2
- - name: Setup Required Tools
- uses: ./.github/workflows/setup-tools
- - name: Build
- run: dotnet build DeviceRunners.sln --configuration Debug /bl:./artifacts/logs/msbuild-build.binlog
- - name: Upload Logs
- uses: actions/upload-artifact@v1
- if: ${{ always() }}
- with:
- name: Logs - macOS
+ name: Logs - ${{ matrix.platform.name }} (${{ matrix.configuration }})
path: ./artifacts/logs
diff --git a/.github/workflows/pack.yml b/.github/workflows/pack.yml
index 4f8d408f..1f48c0bd 100644
--- a/.github/workflows/pack.yml
+++ b/.github/workflows/pack.yml
@@ -16,7 +16,7 @@ jobs:
runs-on: windows-latest
steps:
- name: Checkout
- uses: actions/checkout@v2
+ uses: actions/checkout@v4
- name: Setup Required Tools
uses: ./.github/workflows/setup-tools
- name: Package NuGets
@@ -30,12 +30,12 @@ jobs:
dotnet pack --output ./artifacts/nugets --configuration Release -p:PackageVersion=$VERSION /bl:./artifacts/logs/msbuild-pack.binlog
- name: Upload NuGet Artifacts
- uses: actions/upload-artifact@v1
+ uses: actions/upload-artifact@v4
with:
name: NuGet
path: ./artifacts/nugets
- name: Upload Logs
- uses: actions/upload-artifact@v1
+ uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: Pack Logs - Windows
@@ -55,7 +55,7 @@ jobs:
with:
name: NuGet
- name: Setup .NET
- uses: actions/setup-dotnet@v3
+ uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
source-url: ${{ env.NUGET_URL }}
diff --git a/.github/workflows/setup-tools/action.yml b/.github/workflows/setup-tools/action.yml
index 032ff005..0e872661 100644
--- a/.github/workflows/setup-tools/action.yml
+++ b/.github/workflows/setup-tools/action.yml
@@ -11,9 +11,15 @@ runs:
with:
xcode-version: latest-stable
- name: Setup .NET
- uses: actions/setup-dotnet@v3
+ uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.304
+ - name: Show .NET Info
+ shell: pwsh
+ run: dotnet new globaljson --sdk-version 8.0.304
+ - name: Show .NET Info
+ shell: pwsh
+ run: dotnet --info
- name: Setup .NET MAUI
if: runner.os == 'Linux'
shell: pwsh
diff --git a/.github/workflows/test-xharness-android.yml b/.github/workflows/test-xharness-android.yml
index 0a559585..451ac26a 100644
--- a/.github/workflows/test-xharness-android.yml
+++ b/.github/workflows/test-xharness-android.yml
@@ -11,6 +11,7 @@ jobs:
android:
strategy:
+ fail-fast: false
matrix:
platform:
- name: Linux
@@ -19,7 +20,7 @@ jobs:
- name: macOS
os: macos-13
gpu: guest
- name: Android (${{ matrix.platform.name}})
+ name: Android (${{ matrix.platform.name }})
runs-on: ${{ matrix.platform.os }}
env:
TEST_TARGET_FRAMEWORK: net8.0-android
@@ -29,7 +30,7 @@ jobs:
TEST_EMULATOR_IMAGE: system-images;android-34;google_apis;x86_64
steps:
- name: Checkout
- uses: actions/checkout@v2
+ uses: actions/checkout@v4
- name: Setup Required Tools
uses: ./.github/workflows/setup-tools
- uses: actions/setup-java@v4
@@ -50,7 +51,7 @@ jobs:
run: dotnet android avd start --name ${{ env.TEST_EMULATOR_NAME }} --gpu ${{ matrix.platform.gpu }} --wait-boot --no-window --no-snapshot --no-audio --no-boot-anim
- name: Publish App
run: |
- dotnet publish sample/SampleMauiApp/SampleMauiApp.csproj \
+ dotnet publish sample/test/DeviceTestingKitApp.DeviceTests/DeviceTestingKitApp.DeviceTests.csproj \
-f ${{ env.TEST_TARGET_FRAMEWORK }} \
-r ${{ env.TEST_RUNTIME_IDENTIFIER }} \
-c ${{ env.TEST_CONFIGURATION }} \
@@ -59,18 +60,23 @@ jobs:
/bl:./artifacts/logs/msbuild-publish.binlog
- name: Run Tests
run: |
- dotnet xharness android test \
- --timeout="00:05:00" \
- --launch-timeout=00:10:00 \
- --package-name com.companyname.samplemauiapp \
- --instrumentation devicerunners.xharness.maui.XHarnessInstrumentation \
- --app sample/SampleMauiApp/bin/${{ env.TEST_CONFIGURATION }}/${{ env.TEST_TARGET_FRAMEWORK }}/${{ env.TEST_RUNTIME_IDENTIFIER }}/publish/com.companyname.samplemauiapp-Signed.apk \
- --output-directory artifacts
+ for i in $(seq 1 3)
+ do
+ dotnet xharness android test \
+ --timeout="00:05:00" \
+ --launch-timeout=00:10:00 \
+ --package-name com.companyname.devicetestingkitapp.devicetests \
+ --instrumentation devicerunners.xharness.maui.XHarnessInstrumentation \
+ --app sample/test/DeviceTestingKitApp.DeviceTests/bin/${{ env.TEST_CONFIGURATION }}/${{ env.TEST_TARGET_FRAMEWORK }}/${{ env.TEST_RUNTIME_IDENTIFIER }}/publish/com.companyname.devicetestingkitapp.devicetests-Signed.apk \
+ --output-directory artifacts \
+ && code=0 && break || code=$? && sleep 15
+ done
+ exit $code
- name: Shutdown the Emulator
run: dotnet xharness android adb -- emu kill
- name: Upload Artifacts
- uses: actions/upload-artifact@v1
+ uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
- name: Test Results - Android (Linux)
+ name: Test Results - ${{ matrix.platform.name }}
path: ./artifacts
diff --git a/.github/workflows/test-xharness-ios.yml b/.github/workflows/test-xharness-ios.yml
index 98305f81..38d7ae7c 100644
--- a/.github/workflows/test-xharness-ios.yml
+++ b/.github/workflows/test-xharness-ios.yml
@@ -18,12 +18,12 @@ jobs:
TEST_CONFIGURATION: Debug
steps:
- name: Checkout
- uses: actions/checkout@v2
+ uses: actions/checkout@v4
- name: Setup Required Tools
uses: ./.github/workflows/setup-tools
- name: Publish App
run: |
- dotnet build sample/SampleMauiApp/SampleMauiApp.csproj \
+ dotnet build sample/test/DeviceTestingKitApp.DeviceTests/DeviceTestingKitApp.DeviceTests.csproj \
-f ${{ env.TEST_TARGET_FRAMEWORK }} \
-r ${{ env.TEST_RUNTIME_IDENTIFIER }} \
-c ${{ env.TEST_CONFIGURATION }} \
@@ -37,14 +37,14 @@ jobs:
--target ios-simulator-64 \
--timeout="00:03:00" \
--launch-timeout=00:06:00 \
- --app sample/SampleMauiApp/bin/${{ env.TEST_CONFIGURATION }}/${{ env.TEST_TARGET_FRAMEWORK }}/${{ env.TEST_RUNTIME_IDENTIFIER }}/SampleMauiApp.app \
+ --app sample/test/DeviceTestingKitApp.DeviceTests/bin/${{ env.TEST_CONFIGURATION }}/${{ env.TEST_TARGET_FRAMEWORK }}/${{ env.TEST_RUNTIME_IDENTIFIER }}/DeviceTestingKitApp.DeviceTests.app \
--output-directory artifacts \
&& code=0 && break || code=$? && sleep 15
done
exit $code
- name: Upload Artifacts
- uses: actions/upload-artifact@v1
+ uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
- name: Test Results - iOS
+ name: Test Results
path: ./artifacts
diff --git a/.github/workflows/test-xharness-maccatalyst.yml b/.github/workflows/test-xharness-maccatalyst.yml
index d4fc233d..0600db21 100644
--- a/.github/workflows/test-xharness-maccatalyst.yml
+++ b/.github/workflows/test-xharness-maccatalyst.yml
@@ -18,12 +18,12 @@ jobs:
TEST_CONFIGURATION: Debug
steps:
- name: Checkout
- uses: actions/checkout@v2
+ uses: actions/checkout@v4
- name: Setup Required Tools
uses: ./.github/workflows/setup-tools
- name: Publish App
run: |
- dotnet build sample/SampleMauiApp/SampleMauiApp.csproj \
+ dotnet build sample/test/DeviceTestingKitApp.DeviceTests/DeviceTestingKitApp.DeviceTests.csproj \
-f ${{ env.TEST_TARGET_FRAMEWORK }} \
-r ${{ env.TEST_RUNTIME_IDENTIFIER }} \
-c ${{ env.TEST_CONFIGURATION }} \
@@ -35,11 +35,11 @@ jobs:
--target maccatalyst \
--timeout="00:02:00" \
--launch-timeout=00:06:00 \
- --app sample/SampleMauiApp/bin/${{ env.TEST_CONFIGURATION }}/${{ env.TEST_TARGET_FRAMEWORK }}/${{ env.TEST_RUNTIME_IDENTIFIER }}/SampleMauiApp.app \
+ --app sample/test/DeviceTestingKitApp.DeviceTests/bin/${{ env.TEST_CONFIGURATION }}/${{ env.TEST_TARGET_FRAMEWORK }}/${{ env.TEST_RUNTIME_IDENTIFIER }}/DeviceTestingKitApp.DeviceTests.app \
--output-directory artifacts
- name: Upload Artifacts
- uses: actions/upload-artifact@v1
+ uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
- name: Test Results - Mac Catalyst
+ name: Test Results
path: ./artifacts
diff --git a/.github/workflows/test-xharness-windows.yml b/.github/workflows/test-xharness-windows.yml
index 622d98a8..7385fd1f 100644
--- a/.github/workflows/test-xharness-windows.yml
+++ b/.github/workflows/test-xharness-windows.yml
@@ -18,13 +18,13 @@ jobs:
TEST_CONFIGURATION: Release
steps:
- name: Checkout
- uses: actions/checkout@v2
+ uses: actions/checkout@v4
- name: Setup Required Tools
uses: ./.github/workflows/setup-tools
- name: Publish App
run: |
- $fingerprint = ./scripts/New-Certificate.ps1 -Project sample/SampleMauiApp/SampleMauiApp.csproj
- dotnet publish sample/SampleMauiApp/SampleMauiApp.csproj `
+ $fingerprint = ./scripts/New-Certificate.ps1 -Project sample/test/DeviceTestingKitApp.DeviceTests/DeviceTestingKitApp.DeviceTests.csproj
+ dotnet publish sample/test/DeviceTestingKitApp.DeviceTests/DeviceTestingKitApp.DeviceTests.csproj `
-f ${{ env.TEST_TARGET_FRAMEWORK }} `
-c ${{ env.TEST_CONFIGURATION }} `
-p:TestingMode=XHarness `
@@ -35,15 +35,15 @@ jobs:
./scripts/Remove-Certificate.ps1 -CertificateFingerprint $fingerprint
- name: Run Tests
run: |
- $msix = Get-ChildItem "sample/SampleMauiApp/bin/${{ env.TEST_CONFIGURATION }}/${{ env.TEST_TARGET_FRAMEWORK }}/${{ env.TEST_RUNTIME_IDENTIFIER }}/AppPackages/*_Test/*.msix"
+ $msix = Get-ChildItem "sample/test/DeviceTestingKitApp.DeviceTests/bin/${{ env.TEST_CONFIGURATION }}/${{ env.TEST_TARGET_FRAMEWORK }}/${{ env.TEST_RUNTIME_IDENTIFIER }}/AppPackages/*_Test/*.msix"
./scripts/Start-Tests.ps1 `
-App $msix `
-OutputDirectory artifacts `
-TestingMode XHarness
shell: powershell
- name: Upload Artifacts
- uses: actions/upload-artifact@v1
+ uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
- name: Test Results - Windows
+ name: Test Results
path: ./artifacts
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 3d6f12ff..8c77a0ae 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -9,36 +9,27 @@ on:
jobs:
- windows:
- name: Windows
- runs-on: windows-latest
+ test:
+ strategy:
+ fail-fast: false
+ matrix:
+ platform:
+ - name: Windows
+ os: windows-latest
+ - name: macOS
+ os: macos-14
+ name: ${{ matrix.platform.name }}
+ runs-on: ${{ matrix.platform.os }}
steps:
- name: Checkout
- uses: actions/checkout@v2
+ uses: actions/checkout@v4
- name: Setup Required Tools
uses: ./.github/workflows/setup-tools
- name: Test
run: dotnet test test/DeviceRunners.VisualRunners.Tests --configuration Release /bl:./artifacts/logs/msbuild-test.binlog
- name: Upload Logs
- uses: actions/upload-artifact@v1
+ uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
- name: Logs - Windows
- path: ./artifacts/logs
-
- macos:
- name: macOS
- runs-on: macos-13
- steps:
- - name: Checkout
- uses: actions/checkout@v2
- - name: Setup Required Tools
- uses: ./.github/workflows/setup-tools
- - name: Test
- run: dotnet test test/DeviceRunners.VisualRunners.Tests --configuration Release /bl:./artifacts/logs/msbuild-test.binlog
- - name: Upload Logs
- uses: actions/upload-artifact@v1
- if: ${{ always() }}
- with:
- name: Logs - macOS
+ name: Logs - ${{ matrix.platform.name }}
path: ./artifacts/logs
diff --git a/DeviceRunners.sln b/DeviceRunners.sln
index 002c1e82..85701685 100644
--- a/DeviceRunners.sln
+++ b/DeviceRunners.sln
@@ -9,11 +9,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{DBF1C119-C96
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{5073EAFD-FF7B-4C4E-84D2-3AA38A91DE73}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleMauiApp", "sample\SampleMauiApp\SampleMauiApp.csproj", "{254F1542-8CBD-4FF3-81FB-8C311D53DE70}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DeviceTestingKitApp.DeviceTests", "sample\test\DeviceTestingKitApp.DeviceTests\DeviceTestingKitApp.DeviceTests.csproj", "{254F1542-8CBD-4FF3-81FB-8C311D53DE70}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleNUnitTestProject", "sample\SampleNUnitTestProject\SampleNUnitTestProject.csproj", "{34760EB3-3B55-49A6-8632-ABC6FA5E6786}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DeviceTestingKitApp.Library.NUnitTests", "sample\test\DeviceTestingKitApp.Library.NUnitTests\DeviceTestingKitApp.Library.NUnitTests.csproj", "{34760EB3-3B55-49A6-8632-ABC6FA5E6786}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleXunitTestProject", "sample\SampleXunitTestProject\SampleXunitTestProject.csproj", "{52AB8946-1EDE-4BF2-B397-4422862AB2E1}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DeviceTestingKitApp.MauiLibrary.XunitTests", "sample\test\DeviceTestingKitApp.MauiLibrary.XunitTests\DeviceTestingKitApp.MauiLibrary.XunitTests.csproj", "{52AB8946-1EDE-4BF2-B397-4422862AB2E1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DeviceRunners.Core", "src\DeviceRunners.Core\DeviceRunners.Core.csproj", "{F71BD057-A790-4676-A19D-9AFBB1E8A052}"
EndProject
@@ -41,6 +41,16 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DeviceRunners.UITesting", "
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DeviceRunners.UITesting.Maui", "src\DeviceRunners.UITesting.Maui\DeviceRunners.UITesting.Maui.csproj", "{1D67F157-3201-49D4-AA58-40716D7D00EC}"
EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DeviceTestingKitApp", "sample\src\DeviceTestingKitApp\DeviceTestingKitApp.csproj", "{D9094DA2-3D7F-4613-9569-CCF71629AA1D}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DeviceTestingKitApp.MauiLibrary", "sample\src\DeviceTestingKitApp.MauiLibrary\DeviceTestingKitApp.MauiLibrary.csproj", "{DBAB5271-347E-4C0E-B326-045723583A07}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DeviceTestingKitApp.Library", "sample\src\DeviceTestingKitApp.Library\DeviceTestingKitApp.Library.csproj", "{D4350725-949D-4F7B-ABED-E4F493952D14}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{7FD9E644-B760-47D7-A4FC-61199AFE9D62}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{EE37724C-5FEF-46BB-AD80-CD002CC7FF54}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -113,14 +123,28 @@ Global
{1D67F157-3201-49D4-AA58-40716D7D00EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1D67F157-3201-49D4-AA58-40716D7D00EC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1D67F157-3201-49D4-AA58-40716D7D00EC}.Release|Any CPU.Build.0 = Release|Any CPU
+ {D9094DA2-3D7F-4613-9569-CCF71629AA1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D9094DA2-3D7F-4613-9569-CCF71629AA1D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D9094DA2-3D7F-4613-9569-CCF71629AA1D}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
+ {D9094DA2-3D7F-4613-9569-CCF71629AA1D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D9094DA2-3D7F-4613-9569-CCF71629AA1D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {D9094DA2-3D7F-4613-9569-CCF71629AA1D}.Release|Any CPU.Deploy.0 = Release|Any CPU
+ {DBAB5271-347E-4C0E-B326-045723583A07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {DBAB5271-347E-4C0E-B326-045723583A07}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {DBAB5271-347E-4C0E-B326-045723583A07}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {DBAB5271-347E-4C0E-B326-045723583A07}.Release|Any CPU.Build.0 = Release|Any CPU
+ {D4350725-949D-4F7B-ABED-E4F493952D14}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D4350725-949D-4F7B-ABED-E4F493952D14}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D4350725-949D-4F7B-ABED-E4F493952D14}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D4350725-949D-4F7B-ABED-E4F493952D14}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
- {254F1542-8CBD-4FF3-81FB-8C311D53DE70} = {46348E44-C1A8-4923-B3E9-7B9217BA5792}
- {34760EB3-3B55-49A6-8632-ABC6FA5E6786} = {46348E44-C1A8-4923-B3E9-7B9217BA5792}
- {52AB8946-1EDE-4BF2-B397-4422862AB2E1} = {46348E44-C1A8-4923-B3E9-7B9217BA5792}
+ {254F1542-8CBD-4FF3-81FB-8C311D53DE70} = {EE37724C-5FEF-46BB-AD80-CD002CC7FF54}
+ {34760EB3-3B55-49A6-8632-ABC6FA5E6786} = {EE37724C-5FEF-46BB-AD80-CD002CC7FF54}
+ {52AB8946-1EDE-4BF2-B397-4422862AB2E1} = {EE37724C-5FEF-46BB-AD80-CD002CC7FF54}
{F71BD057-A790-4676-A19D-9AFBB1E8A052} = {DBF1C119-C96C-4DD3-810B-52451603475C}
{9AFBB1E8-A790-4676-A19D-F71BD05A052E} = {DBF1C119-C96C-4DD3-810B-52451603475C}
{709B3B0B-46E7-4EBE-B8CD-1E4BF6D4ADE1} = {DBF1C119-C96C-4DD3-810B-52451603475C}
@@ -134,6 +158,11 @@ Global
{27DD8F93-86FA-4AA8-AEB0-00F6335A4619} = {5073EAFD-FF7B-4C4E-84D2-3AA38A91DE73}
{7040FAB6-5FD1-4D37-9DEB-1529802E2D34} = {DBF1C119-C96C-4DD3-810B-52451603475C}
{1D67F157-3201-49D4-AA58-40716D7D00EC} = {DBF1C119-C96C-4DD3-810B-52451603475C}
+ {D9094DA2-3D7F-4613-9569-CCF71629AA1D} = {7FD9E644-B760-47D7-A4FC-61199AFE9D62}
+ {DBAB5271-347E-4C0E-B326-045723583A07} = {7FD9E644-B760-47D7-A4FC-61199AFE9D62}
+ {D4350725-949D-4F7B-ABED-E4F493952D14} = {7FD9E644-B760-47D7-A4FC-61199AFE9D62}
+ {7FD9E644-B760-47D7-A4FC-61199AFE9D62} = {46348E44-C1A8-4923-B3E9-7B9217BA5792}
+ {EE37724C-5FEF-46BB-AD80-CD002CC7FF54} = {46348E44-C1A8-4923-B3E9-7B9217BA5792}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2DABD41C-B083-429E-AE1E-971CFF8DC199}
diff --git a/README.md b/README.md
index 9bc9c015..826d2154 100644
--- a/README.md
+++ b/README.md
@@ -54,5 +54,5 @@ This is repository contains revised code from a few places:
This code was migrated to use .NET MAUI.
- https://github.com/nunit/nunit.xamarin
This code was migrated to use .NET MAUI and then features were added to support running individual tests.
- - https://github.com/dotnet/maui
+ - https://github.com/dotnet/maui
This was the home for a short while during the migration.
diff --git a/sample/Directory.Build.props b/sample/Directory.Build.props
new file mode 100644
index 00000000..d819ef35
--- /dev/null
+++ b/sample/Directory.Build.props
@@ -0,0 +1,9 @@
+
+
+
+
+
+ false
+
+
+
\ No newline at end of file
diff --git a/sample/README.md b/sample/README.md
new file mode 100644
index 00000000..b9d6e835
--- /dev/null
+++ b/sample/README.md
@@ -0,0 +1,43 @@
+# DeviceTestingKitApp Sample App
+
+This folder contains a convoluted sample app with all the different ways to run and test it.
+
+In a typical scenario, you would not actually do all of this, but rather pick a few
+mechanisms depending on the app type and tests types.
+
+## Projects
+
+### The `src` Folder
+
+This folder represents a ".NET MAUI app" in a somewhat convoluted format to demonstrate
+the different mechanisms available for testing.
+
+This folder has 3 sub-folders with different types of projects:
+
+* `DeviceTestingKitApp`
+ This is the main app that is published to the app store. It is very simple and just
+ contains a single page with some text, and image and a counter button.
+* `DeviceTestingKitApp.MauiLibrary`
+ This is a .NET MAUI class library that use a few features of .NET MAUI in a class
+ library (instead of an app) so that a normal unit test can run against these.
+* `DeviceTestingKitApp.Library`
+ This is a normal class library that has a few view models and services.
+
+### The `test` Folder
+
+This folder represents the possible tests you may have for your app:
+
+* `DeviceTestingKitApp.DeviceTests`
+ This is a device tests app to run all the tests on an actual device instead of just
+ in the IDE on the host machine. The host machine will not be the most accurate test
+ of the features in the app because many code paths may require or expect to be
+ running in an app environment.
+ This project also contains several sample tests to demosnstrate how to write tests that
+ are designed to run on a device and expect device features.
+* `DeviceTestingKitApp.MauiLibrary.XunitTests`
+ This is a set of unit tests (that can run on both the host machine and the device) that
+ test the functionality of the .NET MAUI app components. In this example, it is testing
+ the various XAML views and value converters that only exist in the context of .NET MAUI.
+* `DeviceTestingKitApp.Library.NUnitTests`
+ This is a set of unit tests that test the functionality of view models and other
+ framework-agnostic code.
diff --git a/sample/src/DeviceTestingKitApp.Library/DeviceTestingKitApp.Library.csproj b/sample/src/DeviceTestingKitApp.Library/DeviceTestingKitApp.Library.csproj
new file mode 100644
index 00000000..66aee79e
--- /dev/null
+++ b/sample/src/DeviceTestingKitApp.Library/DeviceTestingKitApp.Library.csproj
@@ -0,0 +1,14 @@
+
+
+
+ net8.0
+ enable
+ enable
+ DeviceTestingKitApp
+
+
+
+
+
+
+
diff --git a/sample/src/DeviceTestingKitApp.Library/Features/ISemanticAnnouncer.cs b/sample/src/DeviceTestingKitApp.Library/Features/ISemanticAnnouncer.cs
new file mode 100644
index 00000000..4d6235b2
--- /dev/null
+++ b/sample/src/DeviceTestingKitApp.Library/Features/ISemanticAnnouncer.cs
@@ -0,0 +1,6 @@
+namespace DeviceTestingKitApp.Features;
+
+public interface ISemanticAnnouncer
+{
+ void Announce(string message);
+}
diff --git a/sample/src/DeviceTestingKitApp.Library/ViewModels/BaseViewModel.cs b/sample/src/DeviceTestingKitApp.Library/ViewModels/BaseViewModel.cs
new file mode 100644
index 00000000..d6e927cf
--- /dev/null
+++ b/sample/src/DeviceTestingKitApp.Library/ViewModels/BaseViewModel.cs
@@ -0,0 +1,7 @@
+using CommunityToolkit.Mvvm.ComponentModel;
+
+namespace DeviceTestingKitApp.ViewModels;
+
+public class BaseViewModel : ObservableObject
+{
+}
diff --git a/sample/src/DeviceTestingKitApp.Library/ViewModels/CounterViewModel.cs b/sample/src/DeviceTestingKitApp.Library/ViewModels/CounterViewModel.cs
new file mode 100644
index 00000000..f2051360
--- /dev/null
+++ b/sample/src/DeviceTestingKitApp.Library/ViewModels/CounterViewModel.cs
@@ -0,0 +1,16 @@
+using CommunityToolkit.Mvvm.ComponentModel;
+using CommunityToolkit.Mvvm.Input;
+
+namespace DeviceTestingKitApp.ViewModels;
+
+public partial class CounterViewModel : BaseViewModel
+{
+ [ObservableProperty]
+ private int _count;
+
+ [RelayCommand]
+ private void Increment()
+ {
+ Count++;
+ }
+}
diff --git a/sample/src/DeviceTestingKitApp.Library/ViewModels/MainViewModel.cs b/sample/src/DeviceTestingKitApp.Library/ViewModels/MainViewModel.cs
new file mode 100644
index 00000000..9fe487f2
--- /dev/null
+++ b/sample/src/DeviceTestingKitApp.Library/ViewModels/MainViewModel.cs
@@ -0,0 +1,11 @@
+namespace DeviceTestingKitApp.ViewModels;
+
+public partial class MainViewModel : BaseViewModel
+{
+ public MainViewModel(CounterViewModel counter)
+ {
+ Counter = counter;
+ }
+
+ public CounterViewModel Counter { get; }
+}
diff --git a/sample/src/DeviceTestingKitApp.MauiLibrary/Controls/CounterView.xaml b/sample/src/DeviceTestingKitApp.MauiLibrary/Controls/CounterView.xaml
new file mode 100644
index 00000000..10fb32f5
--- /dev/null
+++ b/sample/src/DeviceTestingKitApp.MauiLibrary/Controls/CounterView.xaml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sample/src/DeviceTestingKitApp.MauiLibrary/Controls/CounterView.xaml.cs b/sample/src/DeviceTestingKitApp.MauiLibrary/Controls/CounterView.xaml.cs
new file mode 100644
index 00000000..ee9d8259
--- /dev/null
+++ b/sample/src/DeviceTestingKitApp.MauiLibrary/Controls/CounterView.xaml.cs
@@ -0,0 +1,9 @@
+namespace DeviceTestingKitApp.Controls;
+
+public partial class CounterView : ContentView
+{
+ public CounterView()
+ {
+ InitializeComponent();
+ }
+}
diff --git a/sample/src/DeviceTestingKitApp.MauiLibrary/Converters/CounterValueConverter.cs b/sample/src/DeviceTestingKitApp.MauiLibrary/Converters/CounterValueConverter.cs
new file mode 100644
index 00000000..8bf85996
--- /dev/null
+++ b/sample/src/DeviceTestingKitApp.MauiLibrary/Converters/CounterValueConverter.cs
@@ -0,0 +1,22 @@
+using System.Globalization;
+
+namespace DeviceTestingKitApp.Converters;
+
+public class CounterValueConverter : IValueConverter
+{
+ public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
+ {
+ if (value is not int count || targetType != typeof(string))
+ throw new NotSupportedException();
+
+ return count switch
+ {
+ 0 => "Click me!",
+ 1 => $"Clicked {count} time",
+ _ => $"Clicked {count} times"
+ };
+ }
+
+ public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) =>
+ throw new NotSupportedException();
+}
diff --git a/sample/src/DeviceTestingKitApp.MauiLibrary/DeviceTestingKitApp.MauiLibrary.csproj b/sample/src/DeviceTestingKitApp.MauiLibrary/DeviceTestingKitApp.MauiLibrary.csproj
new file mode 100644
index 00000000..dbe37763
--- /dev/null
+++ b/sample/src/DeviceTestingKitApp.MauiLibrary/DeviceTestingKitApp.MauiLibrary.csproj
@@ -0,0 +1,30 @@
+
+
+
+ net8.0;net8.0-android
+ $(TargetFrameworks);net8.0-ios;net8.0-maccatalyst;net8.0-tizen
+ $(TargetFrameworks);net8.0-windows10.0.19041.0
+ true
+ true
+ enable
+ enable
+ DeviceTestingKitApp
+
+ 11.0
+ 13.1
+ 21.0
+ 10.0.17763.0
+ 10.0.17763.0
+ 6.5
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sample/src/DeviceTestingKitApp.MauiLibrary/Features/MauiSemanticAnnouncer.cs b/sample/src/DeviceTestingKitApp.MauiLibrary/Features/MauiSemanticAnnouncer.cs
new file mode 100644
index 00000000..70d0a213
--- /dev/null
+++ b/sample/src/DeviceTestingKitApp.MauiLibrary/Features/MauiSemanticAnnouncer.cs
@@ -0,0 +1,16 @@
+namespace DeviceTestingKitApp.Features;
+
+public class MauiSemanticAnnouncer : ISemanticAnnouncer
+{
+ private readonly ISemanticScreenReader _platformScreenReader;
+
+ public MauiSemanticAnnouncer(ISemanticScreenReader platformScreenReader)
+ {
+ _platformScreenReader = platformScreenReader;
+ }
+
+ public void Announce(string message)
+ {
+ _platformScreenReader.Announce(message);
+ }
+}
diff --git a/sample/src/DeviceTestingKitApp.MauiLibrary/Platforms/Android/PlatformClass1.cs b/sample/src/DeviceTestingKitApp.MauiLibrary/Platforms/Android/PlatformClass1.cs
new file mode 100644
index 00000000..60fd47ba
--- /dev/null
+++ b/sample/src/DeviceTestingKitApp.MauiLibrary/Platforms/Android/PlatformClass1.cs
@@ -0,0 +1,7 @@
+namespace DeviceTestingKitApp.MauiLibrary
+{
+ // All the code in this file is only included on Android.
+ public class PlatformClass1
+ {
+ }
+}
diff --git a/sample/src/DeviceTestingKitApp.MauiLibrary/Platforms/MacCatalyst/PlatformClass1.cs b/sample/src/DeviceTestingKitApp.MauiLibrary/Platforms/MacCatalyst/PlatformClass1.cs
new file mode 100644
index 00000000..484de5fe
--- /dev/null
+++ b/sample/src/DeviceTestingKitApp.MauiLibrary/Platforms/MacCatalyst/PlatformClass1.cs
@@ -0,0 +1,7 @@
+namespace DeviceTestingKitApp.MauiLibrary
+{
+ // All the code in this file is only included on Mac Catalyst.
+ public class PlatformClass1
+ {
+ }
+}
diff --git a/sample/src/DeviceTestingKitApp.MauiLibrary/Platforms/Tizen/PlatformClass1.cs b/sample/src/DeviceTestingKitApp.MauiLibrary/Platforms/Tizen/PlatformClass1.cs
new file mode 100644
index 00000000..dd090cfc
--- /dev/null
+++ b/sample/src/DeviceTestingKitApp.MauiLibrary/Platforms/Tizen/PlatformClass1.cs
@@ -0,0 +1,9 @@
+using System;
+
+namespace DeviceTestingKitApp.MauiLibrary
+{
+ // All the code in this file is only included on Tizen.
+ public class PlatformClass1
+ {
+ }
+}
\ No newline at end of file
diff --git a/sample/src/DeviceTestingKitApp.MauiLibrary/Platforms/Windows/PlatformClass1.cs b/sample/src/DeviceTestingKitApp.MauiLibrary/Platforms/Windows/PlatformClass1.cs
new file mode 100644
index 00000000..b760ae94
--- /dev/null
+++ b/sample/src/DeviceTestingKitApp.MauiLibrary/Platforms/Windows/PlatformClass1.cs
@@ -0,0 +1,7 @@
+namespace DeviceTestingKitApp.MauiLibrary
+{
+ // All the code in this file is only included on Windows.
+ public class PlatformClass1
+ {
+ }
+}
diff --git a/sample/src/DeviceTestingKitApp.MauiLibrary/Platforms/iOS/PlatformClass1.cs b/sample/src/DeviceTestingKitApp.MauiLibrary/Platforms/iOS/PlatformClass1.cs
new file mode 100644
index 00000000..e1559026
--- /dev/null
+++ b/sample/src/DeviceTestingKitApp.MauiLibrary/Platforms/iOS/PlatformClass1.cs
@@ -0,0 +1,7 @@
+namespace DeviceTestingKitApp.MauiLibrary
+{
+ // All the code in this file is only included on iOS.
+ public class PlatformClass1
+ {
+ }
+}
diff --git a/sample/src/DeviceTestingKitApp/App.xaml b/sample/src/DeviceTestingKitApp/App.xaml
new file mode 100644
index 00000000..be2a46ce
--- /dev/null
+++ b/sample/src/DeviceTestingKitApp/App.xaml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sample/src/DeviceTestingKitApp/App.xaml.cs b/sample/src/DeviceTestingKitApp/App.xaml.cs
new file mode 100644
index 00000000..e2c85c2b
--- /dev/null
+++ b/sample/src/DeviceTestingKitApp/App.xaml.cs
@@ -0,0 +1,11 @@
+namespace DeviceTestingKitApp;
+
+public partial class App : Application
+{
+ public App()
+ {
+ InitializeComponent();
+
+ MainPage = new AppShell();
+ }
+}
diff --git a/sample/src/DeviceTestingKitApp/AppShell.xaml b/sample/src/DeviceTestingKitApp/AppShell.xaml
new file mode 100644
index 00000000..a3c81ce7
--- /dev/null
+++ b/sample/src/DeviceTestingKitApp/AppShell.xaml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
diff --git a/sample/src/DeviceTestingKitApp/AppShell.xaml.cs b/sample/src/DeviceTestingKitApp/AppShell.xaml.cs
new file mode 100644
index 00000000..3dd1b57d
--- /dev/null
+++ b/sample/src/DeviceTestingKitApp/AppShell.xaml.cs
@@ -0,0 +1,9 @@
+namespace DeviceTestingKitApp;
+
+public partial class AppShell : Shell
+{
+ public AppShell()
+ {
+ InitializeComponent();
+ }
+}
diff --git a/sample/src/DeviceTestingKitApp/DeviceTestingKitApp.csproj b/sample/src/DeviceTestingKitApp/DeviceTestingKitApp.csproj
new file mode 100644
index 00000000..af0086cf
--- /dev/null
+++ b/sample/src/DeviceTestingKitApp/DeviceTestingKitApp.csproj
@@ -0,0 +1,70 @@
+
+
+
+ net8.0-android;net8.0-ios;net8.0-maccatalyst
+ $(TargetFrameworks);net8.0-windows10.0.19041.0
+
+
+
+
+
+
+ Exe
+ DeviceTestingKitApp
+ true
+ true
+ enable
+ enable
+
+
+ DeviceTestingKitApp
+
+
+ com.companyname.devicetestingkitapp
+
+
+ 1.0
+ 1
+
+ 11.0
+ 13.1
+ 21.0
+ 10.0.17763.0
+ 10.0.17763.0
+ 6.5
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sample/src/DeviceTestingKitApp/MainPage.xaml b/sample/src/DeviceTestingKitApp/MainPage.xaml
new file mode 100644
index 00000000..7cfea1af
--- /dev/null
+++ b/sample/src/DeviceTestingKitApp/MainPage.xaml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sample/src/DeviceTestingKitApp/MainPage.xaml.cs b/sample/src/DeviceTestingKitApp/MainPage.xaml.cs
new file mode 100644
index 00000000..7b066b25
--- /dev/null
+++ b/sample/src/DeviceTestingKitApp/MainPage.xaml.cs
@@ -0,0 +1,13 @@
+using DeviceTestingKitApp.ViewModels;
+
+namespace DeviceTestingKitApp;
+
+public partial class MainPage : ContentPage
+{
+ public MainPage(MainViewModel mainViewModel)
+ {
+ BindingContext = mainViewModel;
+
+ InitializeComponent();
+ }
+}
diff --git a/sample/src/DeviceTestingKitApp/MauiProgram.cs b/sample/src/DeviceTestingKitApp/MauiProgram.cs
new file mode 100644
index 00000000..3356fbe5
--- /dev/null
+++ b/sample/src/DeviceTestingKitApp/MauiProgram.cs
@@ -0,0 +1,38 @@
+using DeviceTestingKitApp.Features;
+using DeviceTestingKitApp.ViewModels;
+
+using Microsoft.Extensions.Logging;
+
+namespace DeviceTestingKitApp;
+
+public static class MauiProgram
+{
+ public static MauiApp CreateMauiApp()
+ {
+ var builder = MauiApp.CreateBuilder();
+ builder
+ .UseMauiApp()
+ .ConfigureFonts(fonts =>
+ {
+ fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
+ fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
+ });
+
+#if DEBUG
+ builder.Logging.AddDebug();
+#endif
+
+ // app pages
+ builder.Services.AddTransient();
+
+ // maui class library
+ builder.Services.AddTransient(_ => SemanticScreenReader.Default);
+ builder.Services.AddTransient();
+
+ // plain class library
+ builder.Services.AddTransient();
+ builder.Services.AddTransient();
+
+ return builder.Build();
+ }
+}
diff --git a/sample/SampleMauiApp/Platforms/Android/AndroidManifest.xml b/sample/src/DeviceTestingKitApp/Platforms/Android/AndroidManifest.xml
similarity index 100%
rename from sample/SampleMauiApp/Platforms/Android/AndroidManifest.xml
rename to sample/src/DeviceTestingKitApp/Platforms/Android/AndroidManifest.xml
diff --git a/sample/SampleMauiApp/Platforms/Android/MainActivity.cs b/sample/src/DeviceTestingKitApp/Platforms/Android/MainActivity.cs
similarity index 92%
rename from sample/SampleMauiApp/Platforms/Android/MainActivity.cs
rename to sample/src/DeviceTestingKitApp/Platforms/Android/MainActivity.cs
index 8f14368d..cab35905 100644
--- a/sample/SampleMauiApp/Platforms/Android/MainActivity.cs
+++ b/sample/src/DeviceTestingKitApp/Platforms/Android/MainActivity.cs
@@ -2,7 +2,7 @@
using Android.Content.PM;
using Android.OS;
-namespace SampleMauiApp;
+namespace DeviceTestingKitApp;
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
public class MainActivity : MauiAppCompatActivity
diff --git a/sample/SampleMauiApp/Platforms/Android/MainApplication.cs b/sample/src/DeviceTestingKitApp/Platforms/Android/MainApplication.cs
similarity index 90%
rename from sample/SampleMauiApp/Platforms/Android/MainApplication.cs
rename to sample/src/DeviceTestingKitApp/Platforms/Android/MainApplication.cs
index de1cff38..feac687e 100644
--- a/sample/SampleMauiApp/Platforms/Android/MainApplication.cs
+++ b/sample/src/DeviceTestingKitApp/Platforms/Android/MainApplication.cs
@@ -1,7 +1,7 @@
using Android.App;
using Android.Runtime;
-namespace SampleMauiApp;
+namespace DeviceTestingKitApp;
[Application]
public class MainApplication : MauiApplication
diff --git a/sample/SampleMauiApp/Platforms/Android/Resources/values/colors.xml b/sample/src/DeviceTestingKitApp/Platforms/Android/Resources/values/colors.xml
similarity index 100%
rename from sample/SampleMauiApp/Platforms/Android/Resources/values/colors.xml
rename to sample/src/DeviceTestingKitApp/Platforms/Android/Resources/values/colors.xml
diff --git a/sample/src/DeviceTestingKitApp/Platforms/MacCatalyst/AppDelegate.cs b/sample/src/DeviceTestingKitApp/Platforms/MacCatalyst/AppDelegate.cs
new file mode 100644
index 00000000..ad1d5a37
--- /dev/null
+++ b/sample/src/DeviceTestingKitApp/Platforms/MacCatalyst/AppDelegate.cs
@@ -0,0 +1,9 @@
+using Foundation;
+
+namespace DeviceTestingKitApp;
+
+[Register("AppDelegate")]
+public class AppDelegate : MauiUIApplicationDelegate
+{
+ protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
+}
diff --git a/sample/src/DeviceTestingKitApp/Platforms/MacCatalyst/Entitlements.plist b/sample/src/DeviceTestingKitApp/Platforms/MacCatalyst/Entitlements.plist
new file mode 100644
index 00000000..de4adc94
--- /dev/null
+++ b/sample/src/DeviceTestingKitApp/Platforms/MacCatalyst/Entitlements.plist
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+ com.apple.security.app-sandbox
+
+
+ com.apple.security.network.client
+
+
+
+
diff --git a/sample/src/DeviceTestingKitApp/Platforms/MacCatalyst/Info.plist b/sample/src/DeviceTestingKitApp/Platforms/MacCatalyst/Info.plist
new file mode 100644
index 00000000..72689771
--- /dev/null
+++ b/sample/src/DeviceTestingKitApp/Platforms/MacCatalyst/Info.plist
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ UIDeviceFamily
+
+ 2
+
+ UIRequiredDeviceCapabilities
+
+ arm64
+
+ UISupportedInterfaceOrientations
+
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+
+ UISupportedInterfaceOrientations~ipad
+
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationPortraitUpsideDown
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+
+ XSAppIconAssets
+ Assets.xcassets/appicon.appiconset
+
+
diff --git a/sample/SampleMauiApp/Platforms/iOS/Program.cs b/sample/src/DeviceTestingKitApp/Platforms/MacCatalyst/Program.cs
similarity index 91%
rename from sample/SampleMauiApp/Platforms/iOS/Program.cs
rename to sample/src/DeviceTestingKitApp/Platforms/MacCatalyst/Program.cs
index 55052f4e..0a42dda0 100644
--- a/sample/SampleMauiApp/Platforms/iOS/Program.cs
+++ b/sample/src/DeviceTestingKitApp/Platforms/MacCatalyst/Program.cs
@@ -1,7 +1,7 @@
using ObjCRuntime;
using UIKit;
-namespace SampleMauiApp;
+namespace DeviceTestingKitApp;
public class Program
{
diff --git a/sample/SampleMauiApp/Platforms/Tizen/Main.cs b/sample/src/DeviceTestingKitApp/Platforms/Tizen/Main.cs
similarity index 89%
rename from sample/SampleMauiApp/Platforms/Tizen/Main.cs
rename to sample/src/DeviceTestingKitApp/Platforms/Tizen/Main.cs
index 8ea9a825..5b06e815 100644
--- a/sample/SampleMauiApp/Platforms/Tizen/Main.cs
+++ b/sample/src/DeviceTestingKitApp/Platforms/Tizen/Main.cs
@@ -2,7 +2,7 @@
using Microsoft.Maui;
using Microsoft.Maui.Hosting;
-namespace SampleMauiApp;
+namespace DeviceTestingKitApp;
class Program : MauiApplication
{
diff --git a/sample/SampleMauiApp/Platforms/Tizen/tizen-manifest.xml b/sample/src/DeviceTestingKitApp/Platforms/Tizen/tizen-manifest.xml
similarity index 84%
rename from sample/SampleMauiApp/Platforms/Tizen/tizen-manifest.xml
rename to sample/src/DeviceTestingKitApp/Platforms/Tizen/tizen-manifest.xml
index 2f7fae2e..207c6aef 100644
--- a/sample/SampleMauiApp/Platforms/Tizen/tizen-manifest.xml
+++ b/sample/src/DeviceTestingKitApp/Platforms/Tizen/tizen-manifest.xml
@@ -1,7 +1,7 @@
-
+
maui-appicon-placeholder
diff --git a/sample/SampleMauiApp/Platforms/Windows/App.xaml b/sample/src/DeviceTestingKitApp/Platforms/Windows/App.xaml
similarity index 70%
rename from sample/SampleMauiApp/Platforms/Windows/App.xaml
rename to sample/src/DeviceTestingKitApp/Platforms/Windows/App.xaml
index c93926de..21665d18 100644
--- a/sample/SampleMauiApp/Platforms/Windows/App.xaml
+++ b/sample/src/DeviceTestingKitApp/Platforms/Windows/App.xaml
@@ -1,8 +1,8 @@
+ xmlns:local="using:DeviceTestingKitApp.WinUI">
diff --git a/sample/SampleMauiApp/Platforms/Windows/App.xaml.cs b/sample/src/DeviceTestingKitApp/Platforms/Windows/App.xaml.cs
similarity index 94%
rename from sample/SampleMauiApp/Platforms/Windows/App.xaml.cs
rename to sample/src/DeviceTestingKitApp/Platforms/Windows/App.xaml.cs
index 1d131724..30c5e878 100644
--- a/sample/SampleMauiApp/Platforms/Windows/App.xaml.cs
+++ b/sample/src/DeviceTestingKitApp/Platforms/Windows/App.xaml.cs
@@ -3,7 +3,7 @@
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
-namespace SampleMauiApp.WinUI;
+namespace DeviceTestingKitApp.WinUI;
///
/// Provides application-specific behavior to supplement the default Application class.
diff --git a/sample/src/DeviceTestingKitApp/Platforms/Windows/Package.appxmanifest b/sample/src/DeviceTestingKitApp/Platforms/Windows/Package.appxmanifest
new file mode 100644
index 00000000..037e4432
--- /dev/null
+++ b/sample/src/DeviceTestingKitApp/Platforms/Windows/Package.appxmanifest
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+ $placeholder$
+ User Name
+ $placeholder$.png
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sample/SampleMauiApp/Platforms/Windows/app.manifest b/sample/src/DeviceTestingKitApp/Platforms/Windows/app.manifest
similarity index 89%
rename from sample/SampleMauiApp/Platforms/Windows/app.manifest
rename to sample/src/DeviceTestingKitApp/Platforms/Windows/app.manifest
index 621f203c..80bcd6af 100644
--- a/sample/SampleMauiApp/Platforms/Windows/app.manifest
+++ b/sample/src/DeviceTestingKitApp/Platforms/Windows/app.manifest
@@ -1,6 +1,6 @@
-
+
diff --git a/sample/src/DeviceTestingKitApp/Platforms/iOS/AppDelegate.cs b/sample/src/DeviceTestingKitApp/Platforms/iOS/AppDelegate.cs
new file mode 100644
index 00000000..ad1d5a37
--- /dev/null
+++ b/sample/src/DeviceTestingKitApp/Platforms/iOS/AppDelegate.cs
@@ -0,0 +1,9 @@
+using Foundation;
+
+namespace DeviceTestingKitApp;
+
+[Register("AppDelegate")]
+public class AppDelegate : MauiUIApplicationDelegate
+{
+ protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
+}
diff --git a/sample/SampleMauiApp/Platforms/iOS/Info.plist b/sample/src/DeviceTestingKitApp/Platforms/iOS/Info.plist
similarity index 100%
rename from sample/SampleMauiApp/Platforms/iOS/Info.plist
rename to sample/src/DeviceTestingKitApp/Platforms/iOS/Info.plist
diff --git a/sample/src/DeviceTestingKitApp/Platforms/iOS/Program.cs b/sample/src/DeviceTestingKitApp/Platforms/iOS/Program.cs
new file mode 100644
index 00000000..0a42dda0
--- /dev/null
+++ b/sample/src/DeviceTestingKitApp/Platforms/iOS/Program.cs
@@ -0,0 +1,15 @@
+using ObjCRuntime;
+using UIKit;
+
+namespace DeviceTestingKitApp;
+
+public class Program
+{
+ // This is the main entry point of the application.
+ static void Main(string[] args)
+ {
+ // if you want to use a different Application Delegate class from "AppDelegate"
+ // you can specify it here.
+ UIApplication.Main(args, null, typeof(AppDelegate));
+ }
+}
diff --git a/sample/SampleMauiApp/Properties/launchSettings.json b/sample/src/DeviceTestingKitApp/Properties/launchSettings.json
similarity index 100%
rename from sample/SampleMauiApp/Properties/launchSettings.json
rename to sample/src/DeviceTestingKitApp/Properties/launchSettings.json
diff --git a/sample/SampleMauiApp/Resources/AppIcon/appicon.svg b/sample/src/DeviceTestingKitApp/Resources/AppIcon/appicon.svg
similarity index 100%
rename from sample/SampleMauiApp/Resources/AppIcon/appicon.svg
rename to sample/src/DeviceTestingKitApp/Resources/AppIcon/appicon.svg
diff --git a/sample/SampleMauiApp/Resources/AppIcon/appiconfg.svg b/sample/src/DeviceTestingKitApp/Resources/AppIcon/appiconfg.svg
similarity index 100%
rename from sample/SampleMauiApp/Resources/AppIcon/appiconfg.svg
rename to sample/src/DeviceTestingKitApp/Resources/AppIcon/appiconfg.svg
diff --git a/sample/src/DeviceTestingKitApp/Resources/Fonts/OpenSans-Regular.ttf b/sample/src/DeviceTestingKitApp/Resources/Fonts/OpenSans-Regular.ttf
new file mode 100644
index 00000000..2d1edf01
Binary files /dev/null and b/sample/src/DeviceTestingKitApp/Resources/Fonts/OpenSans-Regular.ttf differ
diff --git a/sample/src/DeviceTestingKitApp/Resources/Fonts/OpenSans-Semibold.ttf b/sample/src/DeviceTestingKitApp/Resources/Fonts/OpenSans-Semibold.ttf
new file mode 100644
index 00000000..fe13d063
Binary files /dev/null and b/sample/src/DeviceTestingKitApp/Resources/Fonts/OpenSans-Semibold.ttf differ
diff --git a/sample/src/DeviceTestingKitApp/Resources/Images/dotnet_bot.png b/sample/src/DeviceTestingKitApp/Resources/Images/dotnet_bot.png
new file mode 100644
index 00000000..f93ce025
Binary files /dev/null and b/sample/src/DeviceTestingKitApp/Resources/Images/dotnet_bot.png differ
diff --git a/sample/src/DeviceTestingKitApp/Resources/Raw/AboutAssets.txt b/sample/src/DeviceTestingKitApp/Resources/Raw/AboutAssets.txt
new file mode 100644
index 00000000..15d62448
--- /dev/null
+++ b/sample/src/DeviceTestingKitApp/Resources/Raw/AboutAssets.txt
@@ -0,0 +1,15 @@
+Any raw assets you want to be deployed with your application can be placed in
+this directory (and child directories). Deployment of the asset to your application
+is automatically handled by the following `MauiAsset` Build Action within your `.csproj`.
+
+
+
+These files will be deployed with you package and will be accessible using Essentials:
+
+ async Task LoadMauiAsset()
+ {
+ using var stream = await FileSystem.OpenAppPackageFileAsync("AboutAssets.txt");
+ using var reader = new StreamReader(stream);
+
+ var contents = reader.ReadToEnd();
+ }
diff --git a/sample/SampleMauiApp/Resources/Splash/splash.svg b/sample/src/DeviceTestingKitApp/Resources/Splash/splash.svg
similarity index 100%
rename from sample/SampleMauiApp/Resources/Splash/splash.svg
rename to sample/src/DeviceTestingKitApp/Resources/Splash/splash.svg
diff --git a/sample/src/DeviceTestingKitApp/Resources/Styles/Colors.xaml b/sample/src/DeviceTestingKitApp/Resources/Styles/Colors.xaml
new file mode 100644
index 00000000..30307a5d
--- /dev/null
+++ b/sample/src/DeviceTestingKitApp/Resources/Styles/Colors.xaml
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+ #512BD4
+ #ac99ea
+ #242424
+ #DFD8F7
+ #9880e5
+ #2B0B98
+
+ White
+ Black
+ #D600AA
+ #190649
+ #1f1f1f
+
+ #E1E1E1
+ #C8C8C8
+ #ACACAC
+ #919191
+ #6E6E6E
+ #404040
+ #212121
+ #141414
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/sample/src/DeviceTestingKitApp/Resources/Styles/Styles.xaml b/sample/src/DeviceTestingKitApp/Resources/Styles/Styles.xaml
new file mode 100644
index 00000000..e0d36bb7
--- /dev/null
+++ b/sample/src/DeviceTestingKitApp/Resources/Styles/Styles.xaml
@@ -0,0 +1,426 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sample/SampleMauiApp/SampleMauiApp.csproj b/sample/test/DeviceTestingKitApp.DeviceTests/DeviceTestingKitApp.DeviceTests.csproj
similarity index 67%
rename from sample/SampleMauiApp/SampleMauiApp.csproj
rename to sample/test/DeviceTestingKitApp.DeviceTests/DeviceTestingKitApp.DeviceTests.csproj
index bb1c44c1..b61bda12 100644
--- a/sample/SampleMauiApp/SampleMauiApp.csproj
+++ b/sample/test/DeviceTestingKitApp.DeviceTests/DeviceTestingKitApp.DeviceTests.csproj
@@ -5,19 +5,18 @@
$(TargetFrameworks);net8.0-ios;net8.0-maccatalyst;net8.0-tizen
$(TargetFrameworks);net8.0-windows10.0.19041.0
Exe
- SampleMauiApp
+ DeviceTestingKitApp.DeviceTests
true
true
- false
$(DefineConstants);INCLUDE_FAILING_TESTS
$(DefineConstants);MODE_NON_INTERACTIVE_VISUAL
$(DefineConstants);MODE_XHARNESS
- SampleMauiApp
+ DeviceTestingKitApp.DeviceTests
- com.companyname.samplemauiapp
+ com.companyname.devicetestingkitapp.devicetests
1.0
@@ -51,18 +50,18 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
+
+
diff --git a/sample/SampleMauiApp/MauiProgram.cs b/sample/test/DeviceTestingKitApp.DeviceTests/MauiProgram.cs
similarity index 74%
rename from sample/SampleMauiApp/MauiProgram.cs
rename to sample/test/DeviceTestingKitApp.DeviceTests/MauiProgram.cs
index 7a3d9fd4..5f3d6626 100644
--- a/sample/SampleMauiApp/MauiProgram.cs
+++ b/sample/test/DeviceTestingKitApp.DeviceTests/MauiProgram.cs
@@ -6,7 +6,7 @@
using DeviceRunners.XHarness;
#endif
-namespace SampleMauiApp;
+namespace DeviceTestingKitApp.DeviceTests;
public static class MauiProgram
{
@@ -18,7 +18,7 @@ public static MauiApp CreateMauiApp()
#if MODE_XHARNESS
.UseXHarnessTestRunner(conf => conf
.AddTestAssembly(typeof(MauiProgram).Assembly)
- .AddTestAssemblies(typeof(SampleXunitTestProject.UnitTests).Assembly)
+ .AddTestAssemblies(typeof(DeviceTestingKitApp.MauiLibrary.XunitTests.UnitTests).Assembly)
.AddXunit())
#endif
.UseVisualTestRunner(conf => conf
@@ -34,8 +34,8 @@ public static MauiApp CreateMauiApp()
#endif
.AddConsoleResultChannel()
.AddTestAssembly(typeof(MauiProgram).Assembly)
- .AddTestAssemblies(typeof(SampleXunitTestProject.UnitTests).Assembly)
- .AddTestAssemblies(typeof(SampleNUnitTestProject.UnitTests).Assembly)
+ .AddTestAssemblies(typeof(DeviceTestingKitApp.MauiLibrary.XunitTests.UnitTests).Assembly)
+ .AddTestAssemblies(typeof(DeviceTestingKitApp.Library.NUnitTests.UnitTests).Assembly)
.AddXunit()
.AddNUnit());
diff --git a/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/Android/AndroidManifest.xml b/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/Android/AndroidManifest.xml
new file mode 100644
index 00000000..e9937ad7
--- /dev/null
+++ b/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/Android/AndroidManifest.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/Android/MainActivity.cs b/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/Android/MainActivity.cs
new file mode 100644
index 00000000..52e760d5
--- /dev/null
+++ b/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/Android/MainActivity.cs
@@ -0,0 +1,10 @@
+using Android.App;
+using Android.Content.PM;
+using Android.OS;
+
+namespace DeviceTestingKitApp.DeviceTests;
+
+[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
+public class MainActivity : MauiAppCompatActivity
+{
+}
diff --git a/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/Android/MainApplication.cs b/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/Android/MainApplication.cs
new file mode 100644
index 00000000..0c56902a
--- /dev/null
+++ b/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/Android/MainApplication.cs
@@ -0,0 +1,15 @@
+using Android.App;
+using Android.Runtime;
+
+namespace DeviceTestingKitApp.DeviceTests;
+
+[Application]
+public class MainApplication : MauiApplication
+{
+ public MainApplication(IntPtr handle, JniHandleOwnership ownership)
+ : base(handle, ownership)
+ {
+ }
+
+ protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
+}
diff --git a/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/Android/Resources/values/colors.xml b/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/Android/Resources/values/colors.xml
new file mode 100644
index 00000000..c04d7492
--- /dev/null
+++ b/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/Android/Resources/values/colors.xml
@@ -0,0 +1,6 @@
+
+
+ #512BD4
+ #2B0B98
+ #2B0B98
+
\ No newline at end of file
diff --git a/sample/SampleMauiApp/Platforms/iOS/AppDelegate.cs b/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/MacCatalyst/AppDelegate.cs
similarity index 81%
rename from sample/SampleMauiApp/Platforms/iOS/AppDelegate.cs
rename to sample/test/DeviceTestingKitApp.DeviceTests/Platforms/MacCatalyst/AppDelegate.cs
index 796b56fa..cf1f4920 100644
--- a/sample/SampleMauiApp/Platforms/iOS/AppDelegate.cs
+++ b/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/MacCatalyst/AppDelegate.cs
@@ -1,6 +1,6 @@
using Foundation;
-namespace SampleMauiApp;
+namespace DeviceTestingKitApp.DeviceTests;
[Register(nameof(AppDelegate))]
partial class AppDelegate : MauiUIApplicationDelegate
diff --git a/sample/SampleMauiApp/Platforms/MacCatalyst/Info.plist b/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/MacCatalyst/Info.plist
similarity index 100%
rename from sample/SampleMauiApp/Platforms/MacCatalyst/Info.plist
rename to sample/test/DeviceTestingKitApp.DeviceTests/Platforms/MacCatalyst/Info.plist
diff --git a/sample/SampleMauiApp/Platforms/MacCatalyst/Program.cs b/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/MacCatalyst/Program.cs
similarity index 87%
rename from sample/SampleMauiApp/Platforms/MacCatalyst/Program.cs
rename to sample/test/DeviceTestingKitApp.DeviceTests/Platforms/MacCatalyst/Program.cs
index f36b577b..2da80003 100644
--- a/sample/SampleMauiApp/Platforms/MacCatalyst/Program.cs
+++ b/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/MacCatalyst/Program.cs
@@ -1,6 +1,6 @@
using UIKit;
-namespace SampleMauiApp;
+namespace DeviceTestingKitApp.DeviceTests;
public class Program
{
diff --git a/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/Tizen/Main.cs b/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/Tizen/Main.cs
new file mode 100644
index 00000000..233d8b25
--- /dev/null
+++ b/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/Tizen/Main.cs
@@ -0,0 +1,16 @@
+using System;
+using Microsoft.Maui;
+using Microsoft.Maui.Hosting;
+
+namespace DeviceTestingKitApp.DeviceTests;
+
+class Program : MauiApplication
+{
+ protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
+
+ static void Main(string[] args)
+ {
+ var app = new Program();
+ app.Run(args);
+ }
+}
diff --git a/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/Tizen/tizen-manifest.xml b/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/Tizen/tizen-manifest.xml
new file mode 100644
index 00000000..10039b7d
--- /dev/null
+++ b/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/Tizen/tizen-manifest.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+ maui-appicon-placeholder
+
+
+
+
+ http://tizen.org/privilege/internet
+
+
+
+
\ No newline at end of file
diff --git a/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/Windows/App.xaml b/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/Windows/App.xaml
new file mode 100644
index 00000000..8ae0942d
--- /dev/null
+++ b/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/Windows/App.xaml
@@ -0,0 +1,8 @@
+
+
+
diff --git a/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/Windows/App.xaml.cs b/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/Windows/App.xaml.cs
new file mode 100644
index 00000000..c1161730
--- /dev/null
+++ b/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/Windows/App.xaml.cs
@@ -0,0 +1,24 @@
+using Microsoft.UI.Xaml;
+
+// To learn more about WinUI, the WinUI project structure,
+// and more about our project templates, see: http://aka.ms/winui-project-info.
+
+namespace DeviceTestingKitApp.DeviceTests.WinUI;
+
+///
+/// Provides application-specific behavior to supplement the default Application class.
+///
+public partial class App : MauiWinUIApplication
+{
+ ///
+ /// Initializes the singleton application object. This is the first line of authored code
+ /// executed, and as such is the logical equivalent of main() or WinMain().
+ ///
+ public App()
+ {
+ this.InitializeComponent();
+ }
+
+ protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
+}
+
diff --git a/sample/SampleMauiApp/Platforms/Windows/Package.appxmanifest b/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/Windows/Package.appxmanifest
similarity index 93%
rename from sample/SampleMauiApp/Platforms/Windows/Package.appxmanifest
rename to sample/test/DeviceTestingKitApp.DeviceTests/Platforms/Windows/Package.appxmanifest
index ab00ab3c..2a752e77 100644
--- a/sample/SampleMauiApp/Platforms/Windows/Package.appxmanifest
+++ b/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/Windows/Package.appxmanifest
@@ -6,7 +6,7 @@
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap rescap">
-
+
diff --git a/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/Windows/app.manifest b/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/Windows/app.manifest
new file mode 100644
index 00000000..194e4800
--- /dev/null
+++ b/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/Windows/app.manifest
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+ true/PM
+ PerMonitorV2, PerMonitor
+
+
+
diff --git a/sample/SampleMauiApp/Platforms/MacCatalyst/AppDelegate.cs b/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/iOS/AppDelegate.cs
similarity index 81%
rename from sample/SampleMauiApp/Platforms/MacCatalyst/AppDelegate.cs
rename to sample/test/DeviceTestingKitApp.DeviceTests/Platforms/iOS/AppDelegate.cs
index 796b56fa..cf1f4920 100644
--- a/sample/SampleMauiApp/Platforms/MacCatalyst/AppDelegate.cs
+++ b/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/iOS/AppDelegate.cs
@@ -1,6 +1,6 @@
using Foundation;
-namespace SampleMauiApp;
+namespace DeviceTestingKitApp.DeviceTests;
[Register(nameof(AppDelegate))]
partial class AppDelegate : MauiUIApplicationDelegate
diff --git a/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/iOS/Info.plist b/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/iOS/Info.plist
new file mode 100644
index 00000000..0004a4fd
--- /dev/null
+++ b/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/iOS/Info.plist
@@ -0,0 +1,32 @@
+
+
+
+
+ LSRequiresIPhoneOS
+
+ UIDeviceFamily
+
+ 1
+ 2
+
+ UIRequiredDeviceCapabilities
+
+ arm64
+
+ UISupportedInterfaceOrientations
+
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+
+ UISupportedInterfaceOrientations~ipad
+
+ UIInterfaceOrientationPortrait
+ UIInterfaceOrientationPortraitUpsideDown
+ UIInterfaceOrientationLandscapeLeft
+ UIInterfaceOrientationLandscapeRight
+
+ XSAppIconAssets
+ Assets.xcassets/appicon.appiconset
+
+
diff --git a/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/iOS/Program.cs b/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/iOS/Program.cs
new file mode 100644
index 00000000..6338a133
--- /dev/null
+++ b/sample/test/DeviceTestingKitApp.DeviceTests/Platforms/iOS/Program.cs
@@ -0,0 +1,15 @@
+using ObjCRuntime;
+using UIKit;
+
+namespace DeviceTestingKitApp.DeviceTests;
+
+public class Program
+{
+ // This is the main entry point of the application.
+ static void Main(string[] args)
+ {
+ // if you want to use a different Application Delegate class from "AppDelegate"
+ // you can specify it here.
+ UIApplication.Main(args, null, typeof(AppDelegate));
+ }
+}
diff --git a/sample/test/DeviceTestingKitApp.DeviceTests/Properties/launchSettings.json b/sample/test/DeviceTestingKitApp.DeviceTests/Properties/launchSettings.json
new file mode 100644
index 00000000..edf8aadc
--- /dev/null
+++ b/sample/test/DeviceTestingKitApp.DeviceTests/Properties/launchSettings.json
@@ -0,0 +1,8 @@
+{
+ "profiles": {
+ "Windows Machine": {
+ "commandName": "MsixPackage",
+ "nativeDebugging": false
+ }
+ }
+}
\ No newline at end of file
diff --git a/sample/test/DeviceTestingKitApp.DeviceTests/Resources/AppIcon/appicon.svg b/sample/test/DeviceTestingKitApp.DeviceTests/Resources/AppIcon/appicon.svg
new file mode 100644
index 00000000..9d63b651
--- /dev/null
+++ b/sample/test/DeviceTestingKitApp.DeviceTests/Resources/AppIcon/appicon.svg
@@ -0,0 +1,4 @@
+
+
\ No newline at end of file
diff --git a/sample/test/DeviceTestingKitApp.DeviceTests/Resources/AppIcon/appiconfg.svg b/sample/test/DeviceTestingKitApp.DeviceTests/Resources/AppIcon/appiconfg.svg
new file mode 100644
index 00000000..21dfb25f
--- /dev/null
+++ b/sample/test/DeviceTestingKitApp.DeviceTests/Resources/AppIcon/appiconfg.svg
@@ -0,0 +1,8 @@
+
+
+
\ No newline at end of file
diff --git a/sample/SampleMauiApp/Resources/Images/dotnet_bot.svg b/sample/test/DeviceTestingKitApp.DeviceTests/Resources/Images/dotnet_bot.svg
similarity index 100%
rename from sample/SampleMauiApp/Resources/Images/dotnet_bot.svg
rename to sample/test/DeviceTestingKitApp.DeviceTests/Resources/Images/dotnet_bot.svg
diff --git a/sample/SampleMauiApp/Resources/Raw/SampleMauiApp.xunit.runner.json b/sample/test/DeviceTestingKitApp.DeviceTests/Resources/Raw/SampleMauiApp.xunit.runner.json
similarity index 100%
rename from sample/SampleMauiApp/Resources/Raw/SampleMauiApp.xunit.runner.json
rename to sample/test/DeviceTestingKitApp.DeviceTests/Resources/Raw/SampleMauiApp.xunit.runner.json
diff --git a/sample/test/DeviceTestingKitApp.DeviceTests/Resources/Splash/splash.svg b/sample/test/DeviceTestingKitApp.DeviceTests/Resources/Splash/splash.svg
new file mode 100644
index 00000000..21dfb25f
--- /dev/null
+++ b/sample/test/DeviceTestingKitApp.DeviceTests/Resources/Splash/splash.svg
@@ -0,0 +1,8 @@
+
+
+
\ No newline at end of file
diff --git a/sample/SampleMauiApp/Tests/UITests/DynamicUITests.cs b/sample/test/DeviceTestingKitApp.DeviceTests/Tests/UITests/DynamicUITests.cs
similarity index 98%
rename from sample/SampleMauiApp/Tests/UITests/DynamicUITests.cs
rename to sample/test/DeviceTestingKitApp.DeviceTests/Tests/UITests/DynamicUITests.cs
index 34fd0570..8e7f7e75 100644
--- a/sample/SampleMauiApp/Tests/UITests/DynamicUITests.cs
+++ b/sample/test/DeviceTestingKitApp.DeviceTests/Tests/UITests/DynamicUITests.cs
@@ -5,7 +5,7 @@
using static System.Net.Mime.MediaTypeNames;
-namespace SampleMauiApp;
+namespace DeviceTestingKitApp.DeviceTests;
public class DynamicUITests : UITests
{
diff --git a/sample/SampleMauiApp/Tests/UITests/TestPage.xaml b/sample/test/DeviceTestingKitApp.DeviceTests/Tests/UITests/TestPage.xaml
similarity index 93%
rename from sample/SampleMauiApp/Tests/UITests/TestPage.xaml
rename to sample/test/DeviceTestingKitApp.DeviceTests/Tests/UITests/TestPage.xaml
index ec178030..cdc92b4c 100644
--- a/sample/SampleMauiApp/Tests/UITests/TestPage.xaml
+++ b/sample/test/DeviceTestingKitApp.DeviceTests/Tests/UITests/TestPage.xaml
@@ -1,8 +1,8 @@
diff --git a/sample/SampleMauiApp/Tests/UITests/TestPage.xaml.cs b/sample/test/DeviceTestingKitApp.DeviceTests/Tests/UITests/TestPage.xaml.cs
similarity index 66%
rename from sample/SampleMauiApp/Tests/UITests/TestPage.xaml.cs
rename to sample/test/DeviceTestingKitApp.DeviceTests/Tests/UITests/TestPage.xaml.cs
index bacfab1d..6f16bb2f 100644
--- a/sample/SampleMauiApp/Tests/UITests/TestPage.xaml.cs
+++ b/sample/test/DeviceTestingKitApp.DeviceTests/Tests/UITests/TestPage.xaml.cs
@@ -1,4 +1,4 @@
-namespace SampleMauiApp;
+namespace DeviceTestingKitApp.DeviceTests;
partial class TestPage : ContentPage
{
diff --git a/sample/SampleMauiApp/Tests/UITests/TestPageUITests.cs b/sample/test/DeviceTestingKitApp.DeviceTests/Tests/UITests/TestPageUITests.cs
similarity index 93%
rename from sample/SampleMauiApp/Tests/UITests/TestPageUITests.cs
rename to sample/test/DeviceTestingKitApp.DeviceTests/Tests/UITests/TestPageUITests.cs
index ca68e744..053ebb05 100644
--- a/sample/SampleMauiApp/Tests/UITests/TestPageUITests.cs
+++ b/sample/test/DeviceTestingKitApp.DeviceTests/Tests/UITests/TestPageUITests.cs
@@ -1,4 +1,4 @@
-namespace SampleMauiApp;
+namespace DeviceTestingKitApp.DeviceTests;
public class TestPageUITests : UITests
{
diff --git a/sample/SampleMauiApp/Tests/UITests/TestViewModel.cs b/sample/test/DeviceTestingKitApp.DeviceTests/Tests/UITests/TestViewModel.cs
similarity index 91%
rename from sample/SampleMauiApp/Tests/UITests/TestViewModel.cs
rename to sample/test/DeviceTestingKitApp.DeviceTests/Tests/UITests/TestViewModel.cs
index c16118cb..4f352d25 100644
--- a/sample/SampleMauiApp/Tests/UITests/TestViewModel.cs
+++ b/sample/test/DeviceTestingKitApp.DeviceTests/Tests/UITests/TestViewModel.cs
@@ -1,6 +1,6 @@
using System.Windows.Input;
-namespace SampleMauiApp;
+namespace DeviceTestingKitApp.DeviceTests;
public class TestViewModel : BindableObject
{
diff --git a/sample/SampleMauiApp/Tests/UITests/UITests.cs b/sample/test/DeviceTestingKitApp.DeviceTests/Tests/UITests/UITests.cs
similarity index 95%
rename from sample/SampleMauiApp/Tests/UITests/UITests.cs
rename to sample/test/DeviceTestingKitApp.DeviceTests/Tests/UITests/UITests.cs
index cc2de2d8..4020ed33 100644
--- a/sample/SampleMauiApp/Tests/UITests/UITests.cs
+++ b/sample/test/DeviceTestingKitApp.DeviceTests/Tests/UITests/UITests.cs
@@ -1,4 +1,4 @@
-namespace SampleMauiApp;
+namespace DeviceTestingKitApp.DeviceTests;
[Collection("UITests")]
public abstract class UITests : IAsyncLifetime
diff --git a/sample/SampleMauiApp/Tests/UnitTests.cs b/sample/test/DeviceTestingKitApp.DeviceTests/Tests/UnitTests.cs
similarity index 93%
rename from sample/SampleMauiApp/Tests/UnitTests.cs
rename to sample/test/DeviceTestingKitApp.DeviceTests/Tests/UnitTests.cs
index a44f3f04..2da51a37 100644
--- a/sample/SampleMauiApp/Tests/UnitTests.cs
+++ b/sample/test/DeviceTestingKitApp.DeviceTests/Tests/UnitTests.cs
@@ -1,4 +1,4 @@
-namespace SampleMauiApp;
+namespace DeviceTestingKitApp.DeviceTests;
public class UnitTests
{
diff --git a/sample/SampleMauiApp/Tests/UnitTestsWithOutput.cs b/sample/test/DeviceTestingKitApp.DeviceTests/Tests/UnitTestsWithOutput.cs
similarity index 91%
rename from sample/SampleMauiApp/Tests/UnitTestsWithOutput.cs
rename to sample/test/DeviceTestingKitApp.DeviceTests/Tests/UnitTestsWithOutput.cs
index e3022842..f814c0b2 100644
--- a/sample/SampleMauiApp/Tests/UnitTestsWithOutput.cs
+++ b/sample/test/DeviceTestingKitApp.DeviceTests/Tests/UnitTestsWithOutput.cs
@@ -1,6 +1,6 @@
using Xunit.Abstractions;
-namespace SampleMauiApp;
+namespace DeviceTestingKitApp.DeviceTests;
public class UnitTestsWithOutput
{
diff --git a/sample/SampleMauiApp/Usings.cs b/sample/test/DeviceTestingKitApp.DeviceTests/Usings.cs
similarity index 100%
rename from sample/SampleMauiApp/Usings.cs
rename to sample/test/DeviceTestingKitApp.DeviceTests/Usings.cs
diff --git a/sample/SampleNUnitTestProject/SampleNUnitTestProject.csproj b/sample/test/DeviceTestingKitApp.Library.NUnitTests/DeviceTestingKitApp.Library.NUnitTests.csproj
similarity index 88%
rename from sample/SampleNUnitTestProject/SampleNUnitTestProject.csproj
rename to sample/test/DeviceTestingKitApp.Library.NUnitTests/DeviceTestingKitApp.Library.NUnitTests.csproj
index a2f61d61..7bfdb3f9 100644
--- a/sample/SampleNUnitTestProject/SampleNUnitTestProject.csproj
+++ b/sample/test/DeviceTestingKitApp.Library.NUnitTests/DeviceTestingKitApp.Library.NUnitTests.csproj
@@ -5,7 +5,6 @@
enable
enable
INCLUDE_FAILING_TESTS
- false
true
@@ -23,4 +22,8 @@
+
+
+
+
diff --git a/sample/SampleNUnitTestProject/UnitTests.cs b/sample/test/DeviceTestingKitApp.Library.NUnitTests/UnitTests.cs
similarity index 86%
rename from sample/SampleNUnitTestProject/UnitTests.cs
rename to sample/test/DeviceTestingKitApp.Library.NUnitTests/UnitTests.cs
index bcca2d2b..a08f46a9 100644
--- a/sample/SampleNUnitTestProject/UnitTests.cs
+++ b/sample/test/DeviceTestingKitApp.Library.NUnitTests/UnitTests.cs
@@ -1,4 +1,4 @@
-namespace SampleNUnitTestProject;
+namespace DeviceTestingKitApp.Library.NUnitTests;
public class UnitTests
{
diff --git a/sample/SampleNUnitTestProject/Usings.cs b/sample/test/DeviceTestingKitApp.Library.NUnitTests/Usings.cs
similarity index 100%
rename from sample/SampleNUnitTestProject/Usings.cs
rename to sample/test/DeviceTestingKitApp.Library.NUnitTests/Usings.cs
diff --git a/sample/test/DeviceTestingKitApp.Library.NUnitTests/ViewModels/CounterViewModelTests.cs b/sample/test/DeviceTestingKitApp.Library.NUnitTests/ViewModels/CounterViewModelTests.cs
new file mode 100644
index 00000000..65f28ad0
--- /dev/null
+++ b/sample/test/DeviceTestingKitApp.Library.NUnitTests/ViewModels/CounterViewModelTests.cs
@@ -0,0 +1,74 @@
+using DeviceTestingKitApp.ViewModels;
+
+namespace DeviceTestingKitApp.Library.NUnitTests.ViewModels;
+
+public class CounterViewModelTests
+{
+ [Test]
+ public void InitialStateIsCorrect()
+ {
+ var vm = new CounterViewModel();
+
+ Assert.That(vm.Count, Is.EqualTo(0));
+ }
+
+ [Test]
+ public void SingleIncrementIncrementsByOne()
+ {
+ var vm = new CounterViewModel();
+
+ vm.IncrementCommand.Execute(null);
+
+ Assert.That(vm.Count, Is.EqualTo(1));
+ }
+
+ [Test]
+ [TestCase(1)]
+ [TestCase(2)]
+ [TestCase(3)]
+ public void IncrementsIncrementCorrectly(int executeCount)
+ {
+ var vm = new CounterViewModel();
+
+ for (var i = 0; i < executeCount; i++)
+ {
+ vm.IncrementCommand.Execute(null);
+ }
+
+ Assert.That(vm.Count, Is.EqualTo(executeCount));
+ }
+
+ [Test]
+ public void UpdatingCountPropertyTriggersPropertyChanged()
+ {
+ var vm = new CounterViewModel();
+
+ var eventTrigger = 0;
+ vm.PropertyChanged += (sender, args) =>
+ {
+ Assert.That(args.PropertyName, Is.EqualTo(nameof(vm.Count)));
+ eventTrigger++;
+ };
+
+ vm.Count = 5;
+
+ Assert.That(eventTrigger, Is.EqualTo(1));
+ }
+
+ [Test]
+ public void ExecutingCommandTriggersPropertyChanged()
+ {
+ var vm = new CounterViewModel();
+
+ var eventTrigger = 0;
+ vm.PropertyChanged += (sender, args) =>
+ {
+ Assert.That(args.PropertyName, Is.EqualTo(nameof(vm.Count)));
+ eventTrigger++;
+ };
+
+ vm.IncrementCommand.Execute(null);
+
+ Assert.That(eventTrigger, Is.EqualTo(1));
+ }
+}
diff --git a/sample/test/DeviceTestingKitApp.MauiLibrary.XunitTests/Controls/CounterViewTests.cs b/sample/test/DeviceTestingKitApp.MauiLibrary.XunitTests/Controls/CounterViewTests.cs
new file mode 100644
index 00000000..b5a4dd2b
--- /dev/null
+++ b/sample/test/DeviceTestingKitApp.MauiLibrary.XunitTests/Controls/CounterViewTests.cs
@@ -0,0 +1,48 @@
+using DeviceTestingKitApp.Controls;
+using DeviceTestingKitApp.ViewModels;
+
+namespace DeviceTestingKitApp.MauiLibrary.XunitTests.Controls;
+
+public class CounterViewTests : VisualElementTests
+{
+ public CounterViewTests()
+ {
+ View = new CounterView();
+ ViewModel = new CounterViewModel();
+
+ View.BindingContext = ViewModel;
+ }
+
+ public CounterView View { get; }
+
+ public CounterViewModel ViewModel { get; }
+
+ [Fact]
+ public void InitialStateIsCorrect()
+ {
+ var btn = Assert.IsType