Skip to content

Commit b3a5ca3

Browse files
WIP - Try to use Shared Project for Tests and UI components
1 parent 022ee54 commit b3a5ca3

17 files changed

+65
-55
lines changed

UITests/UITests.App/App.xaml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
<Application
2-
x:Class="UITests.App.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:UITests.App">
6-
7-
</Application>
1+
<Application x:Class="UITests.App.App"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:local="using:UITests.App" />

UITests/UITests.App/App.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)
7373
// When the navigation stack isn't restored navigate to the first page,
7474
// configuring the new page by passing required information as a navigation
7575
// parameter
76-
rootFrame.Navigate(typeof(MainPage), e.Arguments);
76+
rootFrame.Navigate(typeof(MainTestHost), e.Arguments);
7777
}
7878

7979
// Ensure the current window is active

UITests/UITests.App/MainPage.xaml renamed to UITests/UITests.App/MainTestHost.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<Page
2-
x:Class="UITests.App.MainPage"
2+
x:Class="UITests.App.MainTestHost"
33
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
44
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
55
xmlns:testhelpers="using:AppTestAutomationHelpers"

UITests/UITests.App/MainPage.xaml.cs renamed to UITests/UITests.App/MainTestHost.xaml.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@
1010

1111
namespace UITests.App
1212
{
13-
public sealed partial class MainPage
13+
/// <summary>
14+
/// MainPage hosting all other test pages.
15+
/// </summary>
16+
public sealed partial class MainTestHost
1417
{
1518
private readonly Dictionary<string, Type> pageMap;
1619

17-
public MainPage()
20+
public MainTestHost()
1821
{
1922
InitializeComponent();
2023
pageMap = ((App)Application.Current).TestPages;

UITests/UITests.App/Pages/SimpleTest.xaml

Lines changed: 0 additions & 13 deletions
This file was deleted.

UITests/UITests.App/UITests.App.csproj

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,9 @@
130130
<Compile Include="App.xaml.cs">
131131
<DependentUpon>App.xaml</DependentUpon>
132132
</Compile>
133-
<Compile Include="MainPage.xaml.cs">
133+
<Compile Include="MainTestHost.xaml.cs">
134134
<DependentUpon>MainPage.xaml</DependentUpon>
135135
</Compile>
136-
<Compile Include="Pages\SimpleTest.xaml.cs">
137-
<DependentUpon>SimpleTest.xaml</DependentUpon>
138-
</Compile>
139-
<Compile Include="Pages\Controls\TextBoxMaskTestPage.xaml.cs">
140-
<DependentUpon>TextBoxMaskTestPage.xaml</DependentUpon>
141-
</Compile>
142136
<Compile Include="Properties\AssemblyInfo.cs" />
143137
</ItemGroup>
144138
<ItemGroup>
@@ -161,17 +155,9 @@
161155
<Generator>MSBuild:Compile</Generator>
162156
<SubType>Designer</SubType>
163157
</ApplicationDefinition>
164-
<Page Include="MainPage.xaml">
165-
<Generator>MSBuild:Compile</Generator>
166-
<SubType>Designer</SubType>
167-
</Page>
168-
<Page Include="Pages\SimpleTest.xaml">
169-
<SubType>Designer</SubType>
158+
<Page Include="MainTestHost.xaml">
170159
<Generator>MSBuild:Compile</Generator>
171-
</Page>
172-
<Page Include="Pages\Controls\TextBoxMaskTestPage.xaml">
173160
<SubType>Designer</SubType>
174-
<Generator>MSBuild:Compile</Generator>
175161
</Page>
176162
</ItemGroup>
177163
<ItemGroup>
@@ -266,4 +252,5 @@
266252
<Target Name="AfterBuild">
267253
</Target>
268254
-->
255+
<Import Project="..\UITests.Tests.Shared\UITests.Tests.Shared.projitems" Label="Shared" />
269256
</Project>

UITests/UITests.Tests.MSTest/UITests.Tests.MSTest.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
<PlatformTarget>x86</PlatformTarget>
1414
<OutputType>Exe</OutputType>
1515
<IsPackable>false</IsPackable>
16+
17+
<IsTestHarness>true</IsTestHarness>
1618
</PropertyGroup>
1719

1820
<ItemGroup>
@@ -27,5 +29,5 @@
2729
<PackageReference Include="Microsoft.Windows.Apps.Test" Version="1.0.181205002" />
2830
</ItemGroup>
2931

30-
<Import Project="..\UITests.Tests.Shared\UITests.Tests.Shared.projitems" />
32+
<Import Project="..\UITests.Tests.Shared\UITests.Tests.Shared.projitems" Label="Shared" />
3133
</Project>

0 commit comments

Comments
 (0)