Skip to content

Commit 93c902c

Browse files
committed
Enabled tests on build process.
1 parent ddf8ee0 commit 93c902c

File tree

12 files changed

+105
-47
lines changed

12 files changed

+105
-47
lines changed

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
</PropertyGroup>
2222

2323
<PropertyGroup>
24-
<SignAssembly Condition="'$(SignAssembly)' == '' and '$(IsUwpProject)' != 'true'" >true</SignAssembly>
24+
<SignAssembly Condition="'$(SignAssembly)' == '' and '$(IsUwpProject)' != 'true' and '$(IsTestSampleProject)' != 'true'" >true</SignAssembly>
2525
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)toolkit.snk</AssemblyOriginatorKeyFile>
2626
</PropertyGroup>
2727

GazeInputTest/App.xaml.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
using Microsoft.Toolkit.Uwp.Input.GazeInteraction;
65
using System;
6+
using Microsoft.Toolkit.Uwp.Input.GazeInteraction;
77
using Windows.ApplicationModel;
88
using Windows.ApplicationModel.Activation;
99
using Windows.UI.Xaml;
@@ -15,9 +15,10 @@ namespace GazeInputTest
1515
/// <summary>
1616
/// Provides application-specific behavior to supplement the default Application class.
1717
/// </summary>
18-
sealed partial class App : Application
18+
public sealed partial class App : Application
1919
{
2020
/// <summary>
21+
/// Initializes a new instance of the <see cref="App"/> class.
2122
/// Initializes the singleton application object. This is the first line of authored code
2223
/// executed, and as such is the logical equivalent of main() or WinMain().
2324
/// </summary>
@@ -47,7 +48,7 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)
4748

4849
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
4950
{
50-
//TODO: Load state from previously suspended application
51+
// TODO: Load state from previously suspended application
5152
}
5253

5354
// Place the frame in the current Window
@@ -63,6 +64,7 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)
6364
// parameter
6465
rootFrame.Navigate(typeof(MainPage), e.Arguments);
6566
}
67+
6668
// Ensure the current window is active
6769
Window.Current.Activate();
6870
}
@@ -75,7 +77,7 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)
7577
/// </summary>
7678
/// <param name="sender">The Frame which failed navigation</param>
7779
/// <param name="e">Details about the navigation failure</param>
78-
void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
80+
private void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
7981
{
8082
throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
8183
}
@@ -90,7 +92,8 @@ void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
9092
private void OnSuspending(object sender, SuspendingEventArgs e)
9193
{
9294
var deferral = e.SuspendingOperation.GetDeferral();
93-
//TODO: Save application state and stop any background activity
95+
96+
// TODO: Save application state and stop any background activity
9497
deferral.Complete();
9598
}
9699
}

GazeInputTest/GazeInputTest.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@
152152
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
153153
<Version>6.2.9</Version>
154154
</PackageReference>
155+
<PackageReference Include="StyleCop.Analyzers">
156+
<Version>1.0.2</Version>
157+
</PackageReference>
155158
</ItemGroup>
156159
<ItemGroup>
157160
<ProjectReference Include="..\Microsoft.Toolkit.UWP.Input.GazeInteraction\Microsoft.Toolkit.Uwp.Input.GazeInteraction.vcxproj">

GazeInputTest/MainPage.xaml.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
using Microsoft.Toolkit.Uwp.Input.GazeInteraction;
65
using System;
6+
using Microsoft.Toolkit.Uwp.Input.GazeInteraction;
77
using Windows.ApplicationModel.Core;
88
using Windows.UI.Core;
99
using Windows.UI.ViewManagement;
@@ -50,18 +50,18 @@ private void ShowCursor_Toggle(object sender, RoutedEventArgs e)
5050
}
5151
}
5252

53-
int clickCount;
53+
private int _clickCount;
5454

5555
private void OnLegacyInvoked(object sender, RoutedEventArgs e)
5656
{
57-
clickCount++;
58-
HowButton.Content = string.Format("{0}: Legacy click", clickCount);
57+
_clickCount++;
58+
HowButton.Content = string.Format("{0}: Legacy click", _clickCount);
5959
}
6060

6161
private void OnGazeInvoked(object sender, DwellInvokedRoutedEventArgs e)
6262
{
63-
clickCount++;
64-
HowButton.Content = string.Format("{0}: Accessible click", clickCount);
63+
_clickCount++;
64+
HowButton.Content = string.Format("{0}: Accessible click", _clickCount);
6565
e.Handled = true;
6666
}
6767

@@ -71,13 +71,13 @@ private void OnInvokeProgress(object sender, DwellProgressEventArgs e)
7171
{
7272
ProgressShow.Value = 100.0 * e.Progress;
7373
}
74+
7475
ProgressShow.IsIndeterminate = e.State == DwellProgressState.Complete;
7576
e.Handled = true;
7677
}
7778

7879
private async void SpawnClicked(object sender, RoutedEventArgs e)
7980
{
80-
8181
var newView = CoreApplication.CreateNewView();
8282
var newViewId = 0;
8383

UnitTests/UnitTests.Notifications.NetCore/UnitTests.Notifications.NetCore.csproj

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55

66
<IsPackable>false</IsPackable>
77

8+
<NoWarn>;CS8002</NoWarn>
9+
810
</PropertyGroup>
911

1012
<ItemGroup>
11-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
12-
<PackageReference Include="MSTest.TestAdapter" Version="1.2.0" />
13-
<PackageReference Include="MSTest.TestFramework" Version="1.2.0" />
13+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
14+
<PackageReference Include="MSTest.TestAdapter" Version="2.1.0" />
15+
<PackageReference Include="MSTest.TestFramework" Version="2.1.0" />
1416
</ItemGroup>
1517

1618
<ItemGroup>

UnitTests/UnitTests.Notifications.UWP/UnitTests.Notifications.UWP.csproj

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
<UnitTestPlatformVersion Condition="'$(UnitTestPlatformVersion)' == ''">$(VisualStudioVersion)</UnitTestPlatformVersion>
2020
<AppxPackageSigningEnabled>false</AppxPackageSigningEnabled>
2121
</PropertyGroup>
22+
<Target Name="Pack">
23+
</Target>
2224
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
2325
<DebugSymbols>true</DebugSymbols>
2426
<OutputPath>bin\x86\Debug\</OutputPath>
@@ -35,7 +37,7 @@
3537
<OutputPath>bin\x86\Release\</OutputPath>
3638
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
3739
<Optimize>true</Optimize>
38-
<NoWarn>;2008</NoWarn>
40+
<NoWarn>;2008;CS8002</NoWarn>
3941
<DebugType>pdbonly</DebugType>
4042
<PlatformTarget>x86</PlatformTarget>
4143
<UseVSHostingProcess>false</UseVSHostingProcess>
@@ -60,7 +62,7 @@
6062
<OutputPath>bin\ARM\Release\</OutputPath>
6163
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
6264
<Optimize>true</Optimize>
63-
<NoWarn>;2008</NoWarn>
65+
<NoWarn>;2008;CS8002</NoWarn>
6466
<DebugType>pdbonly</DebugType>
6567
<PlatformTarget>ARM</PlatformTarget>
6668
<UseVSHostingProcess>false</UseVSHostingProcess>
@@ -85,7 +87,7 @@
8587
<OutputPath>bin\x64\Release\</OutputPath>
8688
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
8789
<Optimize>true</Optimize>
88-
<NoWarn>;2008</NoWarn>
90+
<NoWarn>;2008;CS8002</NoWarn>
8991
<DebugType>pdbonly</DebugType>
9092
<PlatformTarget>x64</PlatformTarget>
9193
<UseVSHostingProcess>false</UseVSHostingProcess>
@@ -113,7 +115,7 @@
113115
<OutputPath>bin\ARM64\Release\</OutputPath>
114116
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
115117
<Optimize>true</Optimize>
116-
<NoWarn>;2008</NoWarn>
118+
<NoWarn>;2008;CS8002</NoWarn>
117119
<DebugType>pdbonly</DebugType>
118120
<PlatformTarget>ARM64</PlatformTarget>
119121
<UseVSHostingProcess>false</UseVSHostingProcess>
@@ -137,6 +139,9 @@
137139
<PackageReference Include="System.ValueTuple">
138140
<Version>4.5.0</Version>
139141
</PackageReference>
142+
<PackageReference Include="System.Xml.XPath.XmlDocument">
143+
<Version>4.3.0</Version>
144+
</PackageReference>
140145
</ItemGroup>
141146
<ItemGroup>
142147
<Compile Include="Properties\AssemblyInfo.cs" />

UnitTests/UnitTests.Notifications.WinRT/UnitTests.Notifications.WinRT.csproj

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
<UnitTestPlatformVersion Condition="'$(UnitTestPlatformVersion)' == ''">$(VisualStudioVersion)</UnitTestPlatformVersion>
2020
<AppxPackageSigningEnabled>false</AppxPackageSigningEnabled>
2121
</PropertyGroup>
22+
<Target Name="Pack">
23+
</Target>
2224
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
2325
<DebugSymbols>true</DebugSymbols>
2426
<OutputPath>bin\x86\Debug\</OutputPath>
@@ -35,7 +37,7 @@
3537
<OutputPath>bin\x86\Release\</OutputPath>
3638
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP;CODE_ANALYSIS;WINRT</DefineConstants>
3739
<Optimize>true</Optimize>
38-
<NoWarn>;2008</NoWarn>
40+
<NoWarn>;2008;CS8002</NoWarn>
3941
<DebugType>pdbonly</DebugType>
4042
<PlatformTarget>x86</PlatformTarget>
4143
<UseVSHostingProcess>false</UseVSHostingProcess>
@@ -60,7 +62,7 @@
6062
<OutputPath>bin\ARM\Release\</OutputPath>
6163
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP;WINRT</DefineConstants>
6264
<Optimize>true</Optimize>
63-
<NoWarn>;2008</NoWarn>
65+
<NoWarn>;2008;CS8002</NoWarn>
6466
<DebugType>pdbonly</DebugType>
6567
<PlatformTarget>ARM</PlatformTarget>
6668
<UseVSHostingProcess>false</UseVSHostingProcess>
@@ -85,7 +87,7 @@
8587
<OutputPath>bin\x64\Release\</OutputPath>
8688
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP;WINRT</DefineConstants>
8789
<Optimize>true</Optimize>
88-
<NoWarn>;2008</NoWarn>
90+
<NoWarn>;2008;CS8002</NoWarn>
8991
<DebugType>pdbonly</DebugType>
9092
<PlatformTarget>x64</PlatformTarget>
9193
<UseVSHostingProcess>false</UseVSHostingProcess>
@@ -113,7 +115,7 @@
113115
<OutputPath>bin\ARM64\Release\</OutputPath>
114116
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP;WINRT</DefineConstants>
115117
<Optimize>true</Optimize>
116-
<NoWarn>;2008</NoWarn>
118+
<NoWarn>;2008;CS8002</NoWarn>
117119
<DebugType>pdbonly</DebugType>
118120
<PlatformTarget>ARM64</PlatformTarget>
119121
<UseVSHostingProcess>false</UseVSHostingProcess>
@@ -129,14 +131,17 @@
129131
<Version>6.2.9</Version>
130132
</PackageReference>
131133
<PackageReference Include="MSTest.TestAdapter">
132-
<Version>1.2.0</Version>
134+
<Version>2.1.0</Version>
133135
</PackageReference>
134136
<PackageReference Include="MSTest.TestFramework">
135-
<Version>1.2.0</Version>
137+
<Version>2.1.0</Version>
136138
</PackageReference>
137139
<PackageReference Include="System.Xml.ReaderWriter">
138140
<Version>4.3.0</Version>
139141
</PackageReference>
142+
<PackageReference Include="System.Xml.XPath.XmlDocument">
143+
<Version>4.3.0</Version>
144+
</PackageReference>
140145
</ItemGroup>
141146
<ItemGroup>
142147
<Compile Include="Properties\AssemblyInfo.cs" />

0 commit comments

Comments
 (0)