Skip to content

Commit 1b7dd5c

Browse files
committed
Init
1 parent 6b5bf5b commit 1b7dd5c

17 files changed

+215
-0
lines changed

Directory.Packages.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.5" />
2828
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="9.0.5" />
2929
<PackageVersion Include="Microsoft.Extensions.Logging" Version="9.0.5" />
30+
<PackageVersion Include="Microsoft.TestPlatform.TestHost" Version="17.13.0" />
3031
<PackageVersion Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.3916" />
3132
<PackageVersion Include="Microsoft.Xaml.Behaviors.WinUI.Managed" Version="3.0.0" />
3233
<PackageVersion Include="OwlCore.Storage" Version="0.12.2" />

Files.slnx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@
7575
</Project>
7676
</Folder>
7777
<Folder Name="/tests/">
78+
<Project Path="tests/Files.App.UnitTests/Files.App.UnitTests.csproj" Id="dcd7e0a5-b198-4359-ab3b-1ca130997337">
79+
<Platform Solution="*|arm64" Project="ARM64" />
80+
<Platform Solution="*|x64" Project="x64" />
81+
<Platform Solution="*|x86" Project="x86" />
82+
<Deploy />
83+
</Project>
7884
<Project Path="tests/Files.App.UITests/Files.App.UITests.csproj">
7985
<Platform Solution="*|arm64" Project="arm64" />
8086
<Platform Solution="*|x64" Project="x64" />

tests/Files.App.UnitTests/App.xaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<Application
2+
x:Class="Files.App.UnitTests.App"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:local="using:Files.App.UnitTests">
6+
7+
<Application.Resources>
8+
<ResourceDictionary>
9+
<ResourceDictionary.MergedDictionaries>
10+
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
11+
</ResourceDictionary.MergedDictionaries>
12+
</ResourceDictionary>
13+
</Application.Resources>
14+
15+
</Application>

tests/Files.App.UnitTests/App.xaml.cs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Copyright (c) Files Community
2+
// Licensed under the MIT License.
3+
4+
using Microsoft.UI.Xaml;
5+
using Microsoft.VisualStudio.TestTools.UnitTesting.AppContainer;
6+
7+
namespace Files.App.UnitTests
8+
{
9+
public partial class App : Application
10+
{
11+
private Window? _window;
12+
13+
public App()
14+
{
15+
InitializeComponent();
16+
}
17+
18+
protected override void OnLaunched(LaunchActivatedEventArgs args)
19+
{
20+
Microsoft.VisualStudio.TestPlatform.TestExecutor.UnitTestClient.CreateDefaultUI();
21+
22+
_window = new MainWindow();
23+
_window.Activate();
24+
25+
UITestMethodAttribute.DispatcherQueue = _window.DispatcherQueue;
26+
27+
Microsoft.VisualStudio.TestPlatform.TestExecutor.UnitTestClient.Run(System.Environment.CommandLine);
28+
}
29+
}
30+
}
Loading
Loading
Loading
Loading
Loading
456 Bytes
Loading

0 commit comments

Comments
 (0)