Skip to content

Commit ec9d0c9

Browse files
WIP - Update Shared Project to Properly Include Files for Intellisense/VS to work
Fix some StyleCop Issues Apply XAML Styler TODO: Page xbfs aren't dropping to the right location to build UWP app now.
1 parent 7f4a172 commit ec9d0c9

File tree

8 files changed

+58
-60
lines changed

8 files changed

+58
-60
lines changed

UITests/UITests.Tests.MSTest/MSTestInterop.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ namespace UITests.Tests
1111
// TAEF has a different terms for the same concepts as compared with MSTest.
1212
// In order to allow both to use the same test files, we'll define these helper classes
1313
// to translate TAEF into MSTest.
14+
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1649:File name should match first type name", Justification = "Shim helpers")]
1415
public static class Log
1516
{
1617
public static void Comment(string format, params object[] args)
@@ -41,6 +42,7 @@ private static void LogMessage(string format, object[] args)
4142
}
4243
}
4344

45+
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:File may only contain a single type", Justification = "Shim helpers.")]
4446
public static class LogController
4547
{
4648
public static void InitializeLogging()
@@ -49,6 +51,7 @@ public static void InitializeLogging()
4951
}
5052
}
5153

54+
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:File may only contain a single type", Justification = "Shim helpers.")]
5255
public static class Verify
5356
{
5457
// TODO: implement

UITests/UITests.Tests.Shared/Controls/TextBoxMaskTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
namespace UITests.Tests
1818
{
1919
[TestClass]
20-
public class TextBoxMask : UITest
20+
public class TextBoxMaskTest : UITestBase
2121
{
2222
[ClassInitialize]
2323
[TestProperty("RunAs", "User")]
Lines changed: 41 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,47 @@
1-
<Page
2-
x:Class="UITests.App.Pages.TextBoxMaskTestPage"
3-
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4-
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5-
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6-
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
7-
xmlns:extensions="using:Microsoft.Toolkit.Uwp.UI.Extensions"
8-
mc:Ignorable="d"
9-
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
10-
<Grid HorizontalAlignment="Center" VerticalAlignment="Center">
1+
<Page x:Class="UITests.App.Pages.TextBoxMaskTestPage"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5+
xmlns:extensions="using:Microsoft.Toolkit.Uwp.UI.Extensions"
6+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
7+
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
8+
mc:Ignorable="d">
9+
<Grid HorizontalAlignment="Center"
10+
VerticalAlignment="Center">
1111
<Grid.RowDefinitions>
12-
<RowDefinition Height="Auto"/>
13-
<RowDefinition Height="10"/>
14-
<RowDefinition Height="Auto"/>
12+
<RowDefinition Height="Auto" />
13+
<RowDefinition Height="10" />
14+
<RowDefinition Height="Auto" />
1515
</Grid.RowDefinitions>
1616
<Grid.ColumnDefinitions>
17-
<ColumnDefinition Width="Auto"/>
18-
<ColumnDefinition Width="10"/>
19-
<ColumnDefinition Width="Auto"/>
17+
<ColumnDefinition Width="Auto" />
18+
<ColumnDefinition Width="10" />
19+
<ColumnDefinition Width="Auto" />
2020
</Grid.ColumnDefinitions>
21-
<Button
22-
x:Name="ChangeButton"
23-
Content="Change Target Value"
24-
Click="ChangeButton_Click"
25-
Grid.Column="0" Grid.Row="0"
26-
/>
27-
<TextBox
28-
x:Name="TextBox"
29-
Width="120"
30-
Padding="0,4,0,0"
31-
VerticalAlignment="Center"
32-
extensions:TextBoxMask.CustomMask="5:[0-5]"
33-
extensions:TextBoxMask.Mask="99:59:59"
34-
TextAlignment="Center"
35-
Text="{x:Bind Value, Mode=OneWay}"
36-
Grid.Column="2" Grid.Row="0"
37-
/>
38-
<TextBlock
39-
x:Name="InitialValueTextBlock"
40-
Text="{x:Bind InitialValue}"
41-
HorizontalAlignment="Center"
42-
Grid.Column="0" Grid.Row="2"
43-
/>
44-
<TextBlock
45-
x:Name="NewValueTextBlock"
46-
Text="{x:Bind NewValue}"
47-
HorizontalAlignment="Center"
48-
Grid.Column="2" Grid.Row="2"
49-
/>
21+
<Button x:Name="ChangeButton"
22+
Grid.Row="0"
23+
Grid.Column="0"
24+
Click="ChangeButton_Click"
25+
Content="Change Target Value" />
26+
<TextBox x:Name="TextBox"
27+
Grid.Row="0"
28+
Grid.Column="2"
29+
Width="120"
30+
Padding="0,4,0,0"
31+
VerticalAlignment="Center"
32+
extensions:TextBoxMask.CustomMask="5:[0-5]"
33+
extensions:TextBoxMask.Mask="99:59:59"
34+
Text="{x:Bind Value, Mode=OneWay}"
35+
TextAlignment="Center" />
36+
<TextBlock x:Name="InitialValueTextBlock"
37+
Grid.Row="2"
38+
Grid.Column="0"
39+
HorizontalAlignment="Center"
40+
Text="{x:Bind InitialValue}" />
41+
<TextBlock x:Name="NewValueTextBlock"
42+
Grid.Row="2"
43+
Grid.Column="2"
44+
HorizontalAlignment="Center"
45+
Text="{x:Bind NewValue}" />
5046
</Grid>
5147
</Page>

UITests/UITests.Tests.Shared/Examples/SimpleTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
namespace UITests.Tests
1818
{
1919
[TestClass]
20-
public class SimpleTest : UITest
20+
public class SimpleTest : UITestBase
2121
{
2222
[ClassInitialize]
2323
[TestProperty("RunAs", "User")]

UITests/UITests.Tests.Shared/Examples/SimpleTestPage.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Page x:Class="UITests.App.Pages.SimpleTest"
1+
<Page x:Class="UITests.App.Pages.SimpleTestPage"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

UITests/UITests.Tests.Shared/Examples/SimpleTestPage.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace UITests.App.Pages
1212
/// </summary>
1313
public sealed partial class SimpleTestPage : Page
1414
{
15-
public SimpleTest()
15+
public SimpleTestPage()
1616
{
1717
this.InitializeComponent();
1818
}

UITests/UITests.Tests.Shared/UITest.cs renamed to UITests/UITests.Tests.Shared/UITestBase.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,8 @@
2020

2121
namespace UITests.Tests
2222
{
23-
public abstract class UITest
23+
public abstract class UITestBase
2424
{
25-
public TestContext TestContext { get; set; }
26-
2725
public static TestApplicationInfo WinUICsUWPSampleApp
2826
{
2927
get
@@ -78,6 +76,7 @@ public static TestSetupHelper.TestSetupHelperOptions TestSetupHelperOptions
7876
}
7977
}
8078

79+
public TestContext TestContext { get; set; }
8180

8281
[TestInitialize]
8382
public void TestInitalize()

UITests/UITests.Tests.Shared/UITests.Tests.Shared.projitems

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
<!-- When we're in the test harness include all '*Test.cs' files -->
1414
<When Condition="'$(IsTestHarness)' == 'true'">
1515
<ItemGroup>
16-
<Compile Include="**\*Test.cs" Exclude="**\bin\**\*Test.cs;**\obj\**\*Test.cs"/>
16+
<Compile Include="$(MSBuildThisFileDirectory)**\*Test.cs" Exclude="**\bin\**\*Test.cs;**\obj\**\*Test.cs"/>
1717
<!-- Base test helpers -->
18-
<Compile Include="$(MSBuildThisFileDirectory)UITest.cs" />
18+
<Compile Include="$(MSBuildThisFileDirectory)UITestBase.cs" />
1919
<Compile Include="$(MSBuildThisFileDirectory)TestAssembly.cs" />
2020
<Compile Include="$(MSBuildThisFileDirectory)TestPageAttribute.cs" />
2121
</ItemGroup>
@@ -26,19 +26,19 @@
2626
<!-- When we're in the UI app used by the test harness, include all the pages -->
2727
<When Condition="'$(IsTestHost)' == 'true'">
2828
<ItemGroup>
29-
<Page Include="**\*Page.xaml" Exclude="**\bin\**\*Page.xaml;**\obj\**\*Page.xaml" SubType="Designer" Generator="MSBuild:Compile" />
30-
<Compile Include="**\*Page.xaml.cs" DependentUpon="%(Filename)" />
29+
<Page Include="$(MSBuildThisFileDirectory)**\*Page.xaml" Exclude="**\bin\**\*Page.xaml;**\obj\**\*Page.xaml" SubType="Designer" Generator="MSBuild:Compile" />
30+
<Compile Include="$(MSBuildThisFileDirectory)**\*Page.xaml.cs" DependentUpon="%(Filename)" />
3131
</ItemGroup>
3232
</When>
3333
</Choose>
3434

3535
<!-- Have a None Include as well to make all items visible in VS in the Shared Project -->
3636
<ItemGroup>
37-
<None Include="**\*Test.cs" Exclude="**\bin\**\*Test.cs;**\obj\**\*Test.cs"/>
38-
<None Include="**\*Page.xaml" Exclude="**\bin\**\*Page.xaml;**\obj\**\*Page.xaml" SubType="Designer" Generator="MSBuild:Compile" />
39-
<None Include="**\*Page.xaml.cs" DependentUpon="%(Filename)" />
37+
<None Include="$(MSBuildThisFileDirectory)**\*Test.cs" Exclude="**\bin\**\*Test.cs;**\obj\**\*Test.cs"/>
38+
<None Include="$(MSBuildThisFileDirectory)**\*Page.xaml" Exclude="**\bin\**\*Page.xaml;**\obj\**\*Page.xaml" SubType="Designer" Generator="MSBuild:Compile" />
39+
<None Include="$(MSBuildThisFileDirectory)**\*Page.xaml.cs" DependentUpon="%(Filename)" />
4040
<!-- Base test helpers -->
41-
<None Include="$(MSBuildThisFileDirectory)UITest.cs" />
41+
<None Include="$(MSBuildThisFileDirectory)UITestBase.cs" />
4242
<None Include="$(MSBuildThisFileDirectory)TestAssembly.cs" />
4343
<None Include="$(MSBuildThisFileDirectory)TestPageAttribute.cs" />
4444
</ItemGroup>

0 commit comments

Comments
 (0)