-
Notifications
You must be signed in to change notification settings - Fork 720
Add a unit test project #1444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Add a unit test project #1444
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+283 Bytes
WinUIGalleryUnitTests/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
|
|
||
| <Package | ||
| xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" | ||
| xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" | ||
| xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" | ||
| xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" | ||
| IgnorableNamespaces="uap rescap"> | ||
|
|
||
| <Identity | ||
| Name="WinUIGalleryUnitTests" | ||
| Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" | ||
| Version="1.0.0.0" /> | ||
|
|
||
| <mp:PhoneIdentity PhoneProductId="3a75d49b-f769-4a7b-91ae-850b7cd79d2d" PhonePublisherId="00000000-0000-0000-0000-000000000000"/> | ||
|
|
||
| <Properties> | ||
| <DisplayName>WinUIGalleryUnitTests</DisplayName> | ||
| <PublisherDisplayName>kmahone</PublisherDisplayName> | ||
| <Logo>Assets\StoreLogo.png</Logo> | ||
| </Properties> | ||
|
|
||
| <Dependencies> | ||
| <TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" /> | ||
| <TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" /> | ||
| </Dependencies> | ||
|
|
||
| <Resources> | ||
| <Resource Language="x-generate"/> | ||
| </Resources> | ||
|
|
||
| <Applications> | ||
| <Application Id="App" | ||
| Executable="$targetnametoken$.exe" | ||
| EntryPoint="$targetentrypoint$"> | ||
| <uap:VisualElements | ||
| DisplayName="WinUIGalleryUnitTests" | ||
| Description="WinUIGalleryUnitTests" | ||
| BackgroundColor="transparent" | ||
| Square150x150Logo="Assets\Square150x150Logo.png" | ||
| Square44x44Logo="Assets\Square44x44Logo.png"> | ||
| <uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" /> | ||
| <uap:SplashScreen Image="Assets\SplashScreen.png" /> | ||
| </uap:VisualElements> | ||
| </Application> | ||
| </Applications> | ||
|
|
||
| <Capabilities> | ||
| <rescap:Capability Name="runFullTrust" /> | ||
| </Capabilities> | ||
| </Package> |
19 changes: 19 additions & 0 deletions
19
WinUIGalleryUnitTests/Properties/PublishProfiles/win-arm64.pubxml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <!-- | ||
| https://go.microsoft.com/fwlink/?LinkID=208121. | ||
| --> | ||
| <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| <PropertyGroup> | ||
| <PublishProtocol>FileSystem</PublishProtocol> | ||
| <Platform>ARM64</Platform> | ||
| <RuntimeIdentifier Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) >= 8">win-arm64</RuntimeIdentifier> | ||
| <RuntimeIdentifier Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) < 8">win10-arm64</RuntimeIdentifier> | ||
| <PublishDir>bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\</PublishDir> | ||
| <SelfContained>true</SelfContained> | ||
| <PublishSingleFile>False</PublishSingleFile> | ||
| <PublishReadyToRun Condition="'$(Configuration)' == 'Debug'">False</PublishReadyToRun> | ||
| <PublishReadyToRun Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRun> | ||
| <PublishTrimmed Condition="'$(Configuration)' == 'Debug'">False</PublishTrimmed> | ||
| <PublishTrimmed Condition="'$(Configuration)' != 'Debug'">True</PublishTrimmed> | ||
| </PropertyGroup> | ||
| </Project> |
19 changes: 19 additions & 0 deletions
19
WinUIGalleryUnitTests/Properties/PublishProfiles/win-x64.pubxml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <!-- | ||
| https://go.microsoft.com/fwlink/?LinkID=208121. | ||
| --> | ||
| <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| <PropertyGroup> | ||
| <PublishProtocol>FileSystem</PublishProtocol> | ||
| <Platform>x64</Platform> | ||
| <RuntimeIdentifier Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) >= 8">win-x64</RuntimeIdentifier> | ||
| <RuntimeIdentifier Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) < 8">win10-x64</RuntimeIdentifier> | ||
| <PublishDir>bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\</PublishDir> | ||
| <SelfContained>true</SelfContained> | ||
| <PublishSingleFile>False</PublishSingleFile> | ||
| <PublishReadyToRun Condition="'$(Configuration)' == 'Debug'">False</PublishReadyToRun> | ||
| <PublishReadyToRun Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRun> | ||
| <PublishTrimmed Condition="'$(Configuration)' == 'Debug'">False</PublishTrimmed> | ||
| <PublishTrimmed Condition="'$(Configuration)' != 'Debug'">True</PublishTrimmed> | ||
| </PropertyGroup> | ||
| </Project> |
19 changes: 19 additions & 0 deletions
19
WinUIGalleryUnitTests/Properties/PublishProfiles/win-x86.pubxml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <!-- | ||
| https://go.microsoft.com/fwlink/?LinkID=208121. | ||
| --> | ||
| <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| <PropertyGroup> | ||
| <PublishProtocol>FileSystem</PublishProtocol> | ||
| <Platform>x86</Platform> | ||
| <RuntimeIdentifier Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) >= 8">win-x86</RuntimeIdentifier> | ||
| <RuntimeIdentifier Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) < 8">win10-x86</RuntimeIdentifier> | ||
| <PublishDir>bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\</PublishDir> | ||
| <SelfContained>true</SelfContained> | ||
| <PublishSingleFile>False</PublishSingleFile> | ||
| <PublishReadyToRun Condition="'$(Configuration)' == 'Debug'">False</PublishReadyToRun> | ||
| <PublishReadyToRun Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRun> | ||
| <PublishTrimmed Condition="'$(Configuration)' == 'Debug'">False</PublishTrimmed> | ||
| <PublishTrimmed Condition="'$(Configuration)' != 'Debug'">True</PublishTrimmed> | ||
| </PropertyGroup> | ||
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "profiles": { | ||
| "WinUIGalleryUnitTests (Package)": { | ||
| "commandName": "MsixPackage" | ||
| }, | ||
| "WinUIGalleryUnitTests (Unpackaged)": { | ||
| "commandName": "Project" | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <Application | ||
| x:Class="WinUIGalleryUnitTests.UnitTestApp" | ||
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
| xmlns:common="using:AppUIBasics.Common" | ||
| xmlns:local="using:WinUIGalleryUnitTests"> | ||
| <Application.Resources> | ||
| <ResourceDictionary> | ||
| <ResourceDictionary.MergedDictionaries> | ||
| <XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" /> | ||
| <!-- Other merged dictionaries here --> | ||
| </ResourceDictionary.MergedDictionaries> | ||
| </ResourceDictionary> | ||
| </Application.Resources> | ||
| </Application> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| using Microsoft.UI.Xaml; | ||
| using Microsoft.UI.Xaml.Controls; | ||
| using Microsoft.UI.Xaml.Controls.Primitives; | ||
| using Microsoft.UI.Xaml.Data; | ||
| using Microsoft.UI.Xaml.Input; | ||
| using Microsoft.UI.Xaml.Media; | ||
| using Microsoft.UI.Xaml.Navigation; | ||
| using Microsoft.UI.Xaml.Shapes; | ||
| using Microsoft.VisualStudio.TestTools.UnitTesting.AppContainer; | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.IO; | ||
| using System.Linq; | ||
| using System.Runtime.InteropServices.WindowsRuntime; | ||
| using Windows.ApplicationModel; | ||
| using Windows.ApplicationModel.Activation; | ||
| using Windows.Foundation; | ||
| using Windows.Foundation.Collections; | ||
|
|
||
| namespace WinUIGalleryUnitTests | ||
| { | ||
| public partial class UnitTestApp : Application | ||
| { | ||
| public UnitTestApp() | ||
| { | ||
| this.InitializeComponent(); | ||
| } | ||
|
|
||
| protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args) | ||
| { | ||
| Microsoft.VisualStudio.TestPlatform.TestExecutor.UnitTestClient.CreateDefaultUI(); | ||
|
|
||
| s_window = new UnitTestAppWindow(); | ||
| s_window.Activate(); | ||
|
|
||
| UITestMethodAttribute.DispatcherQueue = s_window.DispatcherQueue; | ||
|
|
||
| Microsoft.VisualStudio.TestPlatform.TestExecutor.UnitTestClient.Run(Environment.CommandLine); | ||
| } | ||
|
|
||
| private static UnitTestAppWindow s_window; | ||
|
|
||
| public static UnitTestAppWindow UnitTestAppWindow | ||
| { | ||
| get { return s_window; } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <Window | ||
| x:Class="WinUIGalleryUnitTests.UnitTestAppWindow" | ||
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
| xmlns:local="using:WinUIGalleryUnitTests" | ||
| xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
| xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
| mc:Ignorable="d"> | ||
|
|
||
| <Grid x:Name="rootGrid"> | ||
|
|
||
| </Grid> | ||
| </Window> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| using Microsoft.UI.Xaml; | ||
| using Microsoft.UI.Xaml.Controls; | ||
| using Microsoft.UI.Xaml.Controls.Primitives; | ||
| using Microsoft.UI.Xaml.Data; | ||
| using Microsoft.UI.Xaml.Input; | ||
| using Microsoft.UI.Xaml.Media; | ||
| using Microsoft.UI.Xaml.Navigation; | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.IO; | ||
| using System.Linq; | ||
| using System.Runtime.InteropServices.WindowsRuntime; | ||
| using Windows.Foundation; | ||
| using Windows.Foundation.Collections; | ||
|
|
||
| namespace WinUIGalleryUnitTests | ||
| { | ||
| public sealed partial class UnitTestAppWindow : Window | ||
| { | ||
| public UnitTestAppWindow() | ||
| { | ||
| this.InitializeComponent(); | ||
| } | ||
|
|
||
| public Grid RootGrid | ||
| { | ||
| get | ||
| { | ||
| return rootGrid; | ||
| } | ||
| } | ||
|
|
||
| public void AddToVisualTree(UIElement element) | ||
| { | ||
| this.RootGrid.Children.Add(element); | ||
| } | ||
|
|
||
| public void CleanupVisualTree() | ||
| { | ||
| this.RootGrid.Children.Clear(); | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this related to the unit tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At one point I was using it from one of the unit tests. I'll leave it as it is.