Skip to content

Commit 60dd265

Browse files
committed
Added tests back
1 parent f5c2872 commit 60dd265

File tree

4 files changed

+24
-24
lines changed

4 files changed

+24
-24
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Licensed under the MIT License.
33

44
using Microsoft.UI.Xaml;
5-
//using Microsoft.VisualStudio.TestTools.UnitTesting.AppContainer;
5+
using Microsoft.VisualStudio.TestTools.UnitTesting.AppContainer;
66

77
namespace Files.App.UnitTests
88
{
@@ -17,14 +17,14 @@ public App()
1717

1818
protected override void OnLaunched(LaunchActivatedEventArgs args)
1919
{
20-
//Microsoft.VisualStudio.TestPlatform.TestExecutor.UnitTestClient.CreateDefaultUI();
20+
Microsoft.VisualStudio.TestPlatform.TestExecutor.UnitTestClient.CreateDefaultUI();
2121

2222
_window = new MainWindow();
2323
_window.Activate();
2424

25-
//UITestMethodAttribute.DispatcherQueue = _window.DispatcherQueue;
25+
UITestMethodAttribute.DispatcherQueue = _window.DispatcherQueue;
2626

27-
//Microsoft.VisualStudio.TestPlatform.TestExecutor.UnitTestClient.Run(Environment.CommandLine);
27+
Microsoft.VisualStudio.TestPlatform.TestExecutor.UnitTestClient.Run(System.Environment.CommandLine);
2828
}
2929
}
3030
}

tests/Files.App.UnitTests/Files.App.UnitTests.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,22 @@
2121
<ItemGroup>
2222
<Manifest Include="$(ApplicationManifest)" />
2323
<Content Include="Assets\*.png" />
24-
<!--<ProjectCapability Include="TestContainer" />-->
24+
<ProjectCapability Include="TestContainer" />
2525
<ProjectCapability Condition="'$(DisableMsixProjectCapabilityAddedByProject)'!='true' and '$(EnableMsixTooling)'=='true'" Include="Msix" />
2626
</ItemGroup>
2727

2828
<ItemGroup>
29-
<!--<PackageReference Include="Microsoft.TestPlatform.TestHost" />
29+
<PackageReference Include="Microsoft.TestPlatform.TestHost" />
3030
<PackageReference Include="MSTest.TestAdapter" />
31-
<PackageReference Include="MSTest.TestFramework" />-->
31+
<PackageReference Include="MSTest.TestFramework" />
3232
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" />
3333
<PackageReference Include="Microsoft.WindowsAppSDK" />
3434
</ItemGroup>
3535

36-
<!--<ItemGroup>
36+
<ItemGroup>
3737
<ProjectReference Include="..\..\src\Files.App.CsWin32\Files.App.CsWin32.csproj" />
3838
<ProjectReference Include="..\..\src\Files.App.Storage\Files.App.Storage.csproj" />
3939
<ProjectReference Include="..\..\src\Files.Shared\Files.Shared.csproj" />
40-
</ItemGroup>-->
40+
</ItemGroup>
4141

4242
</Project>

tests/Files.App.UnitTests/Package.appxmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<Identity
99
Name="f20f07f5-b301-4f12-92af-febb4e36abaf"
1010
Publisher="CN=Files Community"
11-
Version="1.0.0.0" />
11+
Version="1.0.2.0" />
1212

1313
<Properties>
1414
<DisplayName>Files Unit Test WinUI app</DisplayName>

tests/Files.App.UnitTests/UnitTests.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@
22
// Licensed under the MIT License.
33

44
using Microsoft.UI.Xaml.Controls;
5-
//using Microsoft.VisualStudio.TestTools.UnitTesting;
6-
//using Microsoft.VisualStudio.TestTools.UnitTesting.AppContainer;
5+
using Microsoft.VisualStudio.TestTools.UnitTesting;
6+
using Microsoft.VisualStudio.TestTools.UnitTesting.AppContainer;
77

88
namespace App1
99
{
10-
//[TestClass]
10+
[TestClass]
1111
public class UnitTest1
1212
{
13-
//[TestMethod]
14-
//public void TestMethod1()
15-
//{
16-
// Assert.AreEqual(0, 0);
17-
//}
13+
[TestMethod]
14+
public void TestMethod1()
15+
{
16+
Assert.AreEqual(0, 0);
17+
}
1818

19-
//[UITestMethod]
20-
//public void TestMethod2()
21-
//{
22-
// var grid = new Grid();
23-
// Assert.AreEqual(0, grid.MinWidth);
24-
//}
19+
[UITestMethod]
20+
public void TestMethod2()
21+
{
22+
var grid = new Grid();
23+
Assert.AreEqual(0, grid.MinWidth);
24+
}
2525
}
2626
}

0 commit comments

Comments
 (0)