Skip to content

A Swiss Army knife for developers.

Fixed unit tests

Etienne Baudouxfbc37233769b
diff --git a/src/dev/impl/Directory.Build.props b/src/dev/impl/Directory.Build.props
index f090c8732..12efa6eb0 100644
--- a/src/dev/impl/Directory.Build.props
+++ b/src/dev/impl/Directory.Build.props
@@ -7,13 +7,6 @@
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
- <!-- Defines the bin and obj folder paths -->
- <RepoRoot>$([System.IO.Path]::GetDirectoryName($([MSBuild]::GetPathOfFileAbove('.gitignore', '$(MSBuildThisFileDirectory)'))))\</RepoRoot>
- <BaseOutputPath>$(RepoRoot)bin\</BaseOutputPath>
- <BaseIntermediateOutputPath>$(RepoRoot)obj\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</BaseIntermediateOutputPath>
- <OutputPath>$(BaseOutputPath)$(Platform)\$(Configuration)\$(MSBuildProjectName)\</OutputPath>
- <PackagesConfigRestorePath>$(RepoRoot)packages\</PackagesConfigRestorePath>
-
<!-- Enable generation of .tt files -->
<TransformOnBuild>true</TransformOnBuild>
<OverwriteReadOnlyOutputFiles>true</OverwriteReadOnlyOutputFiles>
diff --git a/src/tests/DevToys.Tests/DevToys.Tests.csproj b/src/tests/DevToys.Tests/DevToys.Tests.csproj
index b254f9522..ef6f34eff 100644
--- a/src/tests/DevToys.Tests/DevToys.Tests.csproj
+++ b/src/tests/DevToys.Tests/DevToys.Tests.csproj
@@ -16,9 +16,38 @@
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<UnitTestPlatformVersion Condition="'$(UnitTestPlatformVersion)' == ''">$(VisualStudioVersion)</UnitTestPlatformVersion>
<AppxPackageSigningEnabled>false</AppxPackageSigningEnabled>
- <RuntimeIdentifiers>win10</RuntimeIdentifiers>
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
+ <IsTestProject>true</IsTestProject>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)' == 'Debug'">
+ <DebugSymbols>true</DebugSymbols>
+ <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
+ <DebugType>full</DebugType>
+ </PropertyGroup>
+
+ <PropertyGroup Condition="'$(Configuration)' == 'Release'">
+ <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
+ <Optimize>true</Optimize>
+ <DebugType>pdbonly</DebugType>
+ <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
+ </PropertyGroup>
+
+ <PropertyGroup Condition="'$(Platform)' == 'x86'">
+ <PlatformTarget>x86</PlatformTarget>
+ </PropertyGroup>
+
+ <PropertyGroup Condition="'$(Platform)' == 'x64'">
+ <PlatformTarget>x64</PlatformTarget>
+ </PropertyGroup>
+
+ <PropertyGroup Condition="'$(Platform)' == 'ARM'">
+ <PlatformTarget>ARM</PlatformTarget>
+ </PropertyGroup>
+
+ <PropertyGroup Condition="'$(Platform)' == 'ARM64'">
+ <PlatformTarget>ARM64</PlatformTarget>
+ </PropertyGroup>
+
<ItemGroup>
<SDKReference Include="TestPlatform.Universal, Version=$(UnitTestPlatformVersion)" />
</ItemGroup>
diff --git a/src/tests/DevToys.Tests/UnitTestApp.xaml.cs b/src/tests/DevToys.Tests/UnitTestApp.xaml.cs
index 1afbf8e54..f847904b6 100644
--- a/src/tests/DevToys.Tests/UnitTestApp.xaml.cs
+++ b/src/tests/DevToys.Tests/UnitTestApp.xaml.cs
@@ -40,10 +40,10 @@ namespace DevToys.Tests
// Do not repeat app initialization when the Window already has content,
// just ensure that the window is active
- if (Window.Current.Content is not Frame rootFrame)
+ if (Window.Current.Content == null)
{
// Create a Frame to act as the navigation context and navigate to the first page
- rootFrame = new Frame();
+ var rootFrame = new Frame();
rootFrame.NavigationFailed += OnNavigationFailed;