diff --git a/Directory.Build.props b/Directory.Build.props
index 4c837faa9c4..3425817285a 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -58,11 +58,16 @@
-
+
-
-
+
+
+
+
+
+
+
diff --git a/Microsoft.Toolkit.Uwp.PlatformDifferencesGen/DifferencesGen.csproj b/Microsoft.Toolkit.Uwp.PlatformDifferencesGen/DifferencesGen.csproj
index 39613baf204..e2726cf8cc5 100644
--- a/Microsoft.Toolkit.Uwp.PlatformDifferencesGen/DifferencesGen.csproj
+++ b/Microsoft.Toolkit.Uwp.PlatformDifferencesGen/DifferencesGen.csproj
@@ -30,6 +30,8 @@
TRACE
prompt
4
+ bin\Release\DifferencesGen.xml
+ 1591
diff --git a/Microsoft.Toolkit.Uwp.SampleApp/.editorconfig b/Microsoft.Toolkit.Uwp.SampleApp/.editorconfig
new file mode 100644
index 00000000000..68caad1b9dc
--- /dev/null
+++ b/Microsoft.Toolkit.Uwp.SampleApp/.editorconfig
@@ -0,0 +1,7 @@
+[*.{cs,vb}]
+
+# SA1601: Partial elements should be documented
+dotnet_diagnostic.SA1601.severity = none
+dotnet_diagnostic.CS1573.severity = none
+dotnet_diagnostic.CS1591.severity = none
+dotnet_diagnostic.CS1712.severity = none
\ No newline at end of file
diff --git a/Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.csproj b/Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.csproj
index d95e24c902f..db67c3365e3 100644
--- a/Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.csproj
+++ b/Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.csproj
@@ -32,9 +32,7 @@
false
prompt
true
-
-
- microsoft.toolkit.uwp.sampleapp.ruleset
+ $(OutputPath)$(AssemblyName).xml
bin\x86\Release\
@@ -49,9 +47,7 @@
true
false
true
-
-
- microsoft.toolkit.uwp.sampleapp.ruleset
+ $(OutputPath)$(AssemblyName).xml
true
@@ -63,7 +59,6 @@
false
prompt
true
- microsoft.toolkit.uwp.sampleapp.ruleset
bin\ARM\Release\
@@ -78,9 +73,7 @@
true
false
true
-
-
- microsoft.toolkit.uwp.sampleapp.ruleset
+ $(OutputPath)$(AssemblyName).xml
true
@@ -92,7 +85,6 @@
false
prompt
true
- microsoft.toolkit.uwp.sampleapp.ruleset
bin\x64\Release\
@@ -107,9 +99,7 @@
true
false
true
-
-
- microsoft.toolkit.uwp.sampleapp.ruleset
+ $(OutputPath)$(AssemblyName).xml
PackageReference
@@ -130,9 +120,6 @@
0.7.0-alpha
-
- 1.0.2
-
1.1.0
@@ -385,7 +372,7 @@
PreserveNewest
-
+
@@ -1449,7 +1436,6 @@
ARM64
false
prompt
- microsoft.toolkit.uwp.sampleapp.ruleset
true
@@ -1463,7 +1449,6 @@
ARM64
false
prompt
- microsoft.toolkit.uwp.sampleapp.ruleset
true
diff --git a/Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.ruleset b/Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.ruleset
deleted file mode 100644
index 2c59c75e105..00000000000
--- a/Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.ruleset
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/CameraHelper/CameraHelperPage.xaml.cs b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/CameraHelper/CameraHelperPage.xaml.cs
index 53b9ee17452..9ae9b92e75b 100644
--- a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/CameraHelper/CameraHelperPage.xaml.cs
+++ b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/CameraHelper/CameraHelperPage.xaml.cs
@@ -141,7 +141,7 @@ private async Task CleanUpAsync()
{
_cameraHelper.FrameArrived -= CameraHelper_FrameArrived;
await _cameraHelper.CleanUpAsync();
- _cameraHelper = null;
+ _cameraHelper = null;
}
}
}
diff --git a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/Incremental Loading Collection/IncrementalLoadingCollectionPage.xaml.cs b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/Incremental Loading Collection/IncrementalLoadingCollectionPage.xaml.cs
index f6e14858333..0556a62a002 100644
--- a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/Incremental Loading Collection/IncrementalLoadingCollectionPage.xaml.cs
+++ b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/Incremental Loading Collection/IncrementalLoadingCollectionPage.xaml.cs
@@ -7,7 +7,7 @@
namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
{
///
- /// A sample XAML page that shows how to use and classes.
+ /// A sample XAML page that shows how to use and classes.
///
public sealed partial class IncrementalLoadingCollectionPage
{
diff --git a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/Incremental Loading Collection/PeopleSource.cs b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/Incremental Loading Collection/PeopleSource.cs
index ebb03d90bb1..a3de37d1379 100644
--- a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/Incremental Loading Collection/PeopleSource.cs
+++ b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/Incremental Loading Collection/PeopleSource.cs
@@ -11,9 +11,9 @@
namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
{
///
- /// A sample implementation of the interface.
+ /// A sample implementation of the interface.
///
- ///
+ ///
public class PeopleSource : Collections.IIncrementalSource
{
private readonly List _people;
diff --git a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/Incremental Loading Collection/Person.cs b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/Incremental Loading Collection/Person.cs
index f15b73e465d..e591d2d3c80 100644
--- a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/Incremental Loading Collection/Person.cs
+++ b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/Incremental Loading Collection/Person.cs
@@ -5,7 +5,7 @@
namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
{
///
- /// A sample class used to show how to use the interface.
+ /// A sample class used to show how to use the interface.
///
public class Person
{
diff --git a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/TokenizingTextBox/SampleDataType.cs b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/TokenizingTextBox/SampleDataType.cs
index 0ec6de9df7a..79448dbd406 100644
--- a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/TokenizingTextBox/SampleDataType.cs
+++ b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/TokenizingTextBox/SampleDataType.cs
@@ -7,7 +7,7 @@
namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
{
///
- /// Sample of strongly-typed data for .
+ /// Sample of strongly-typed data for .
///
public class SampleDataType
{
diff --git a/Microsoft.Toolkit.Uwp.Samples.BackgroundTasks/Microsoft.Toolkit.Uwp.Samples.BackgroundTasks.csproj b/Microsoft.Toolkit.Uwp.Samples.BackgroundTasks/Microsoft.Toolkit.Uwp.Samples.BackgroundTasks.csproj
index 22790daed6c..34fddfc1331 100644
--- a/Microsoft.Toolkit.Uwp.Samples.BackgroundTasks/Microsoft.Toolkit.Uwp.Samples.BackgroundTasks.csproj
+++ b/Microsoft.Toolkit.Uwp.Samples.BackgroundTasks/Microsoft.Toolkit.Uwp.Samples.BackgroundTasks.csproj
@@ -28,7 +28,6 @@
DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
prompt
4
- Microsoft.Toolkit.Uwp.Samples.BackgroundTasks.ruleset
AnyCPU
@@ -38,7 +37,6 @@
TRACE;NETFX_CORE;WINDOWS_UWP
prompt
4
- Microsoft.Toolkit.Uwp.Samples.BackgroundTasks.ruleset
x86
@@ -50,7 +48,6 @@
x86
false
prompt
- Microsoft.Toolkit.Uwp.Samples.BackgroundTasks.ruleset
x86
@@ -62,7 +59,6 @@
x86
false
prompt
- Microsoft.Toolkit.Uwp.Samples.BackgroundTasks.ruleset
ARM
@@ -74,7 +70,6 @@
ARM
false
prompt
- Microsoft.Toolkit.Uwp.Samples.BackgroundTasks.ruleset
ARM
@@ -86,7 +81,6 @@
ARM
false
prompt
- Microsoft.Toolkit.Uwp.Samples.BackgroundTasks.ruleset
x64
@@ -98,7 +92,6 @@
x64
false
prompt
- Microsoft.Toolkit.Uwp.Samples.BackgroundTasks.ruleset
x64
@@ -110,7 +103,6 @@
x64
false
prompt
- Microsoft.Toolkit.Uwp.Samples.BackgroundTasks.ruleset
PackageReference
@@ -120,10 +112,6 @@
6.2.9
-
-
-
-
@@ -146,7 +134,6 @@
ARM64
false
prompt
- Microsoft.Toolkit.Uwp.Samples.BackgroundTasks.ruleset
bin\ARM64\Release\
@@ -157,7 +144,6 @@
ARM64
false
prompt
- Microsoft.Toolkit.Uwp.Samples.BackgroundTasks.ruleset
") as FrameworkElement;
- var expected = new(int row, int col)[]
+ var expected = new (int row, int col)[]
{
(0, 1),
(0, 2),
@@ -163,7 +161,7 @@ public void Test_UniformGrid_AutoLayout_FixedElementSquare()
") as FrameworkElement;
- var expected = new(int row, int col)[]
+ var expected = new (int row, int col)[]
{
(0, 0),
(1, 1),
@@ -361,7 +359,7 @@ public void Test_UniformGrid_AutoLayout_LargeElement()
") as FrameworkElement;
- var expected = new(int row, int col)[]
+ var expected = new (int row, int col)[]
{
(0, 0),
(0, 2),
@@ -438,5 +436,4 @@ public void Test_UniformGrid_AutoLayout_HorizontalElement_FixedPosition()
Assert.AreEqual(0, Grid.GetColumn(border2));
}
}
- #pragma warning restore SA1008 // Opening parenthesis must be spaced correctly
}
\ No newline at end of file
diff --git a/UnitTests/UI/Controls/Test_UniformGrid_Dimensions.cs b/UnitTests/UI/Controls/Test_UniformGrid_Dimensions.cs
index 375e9c1b02b..db58e683413 100644
--- a/UnitTests/UI/Controls/Test_UniformGrid_Dimensions.cs
+++ b/UnitTests/UI/Controls/Test_UniformGrid_Dimensions.cs
@@ -13,7 +13,6 @@
namespace UnitTests.UI.Controls
{
[TestClass]
- #pragma warning disable SA1008 // Opening parenthesis must be spaced correctly
public class Test_UniformGrid_Dimensions
{
[TestCategory("UniformGrid")]
@@ -230,5 +229,4 @@ public void Test_UniformGrid_GetDimensions_FirstColumnEqualsColumns()
Assert.AreEqual(7, columns, "Expected seven columns.");
}
}
- #pragma warning restore SA1008 // Opening parenthesis must be spaced correctly
}
\ No newline at end of file
diff --git a/UnitTests/UI/Controls/Test_UniformGrid_FreeSpots.cs b/UnitTests/UI/Controls/Test_UniformGrid_FreeSpots.cs
index 1c7be7e7b22..60069fe0759 100644
--- a/UnitTests/UI/Controls/Test_UniformGrid_FreeSpots.cs
+++ b/UnitTests/UI/Controls/Test_UniformGrid_FreeSpots.cs
@@ -11,7 +11,6 @@
namespace UnitTests.UI.Controls
{
[TestClass]
- #pragma warning disable SA1008 // Opening parenthesis must be spaced correctly
public class Test_UniformGrid_FreeSpots
{
[TestCategory("UniformGrid")]
@@ -28,19 +27,19 @@ public void Test_UniformGrid_GetFreeSpots_Basic()
var results = UniformGrid.GetFreeSpot(testref, 0, false).ToArray();
- var expected = new(int row, int column)[]
+ var expected = new (int row, int column)[]
{
- (0, 0), (0, 2), (0, 4),
- (1, 0), (1, 4),
- (2, 0), (2, 2), (2, 4),
- (3, 0),(3, 1), (3, 3),(3, 4)
+ (0, 0), (0, 2), (0, 4),
+ (1, 0), (1, 4),
+ (2, 0), (2, 2), (2, 4),
+ (3, 0), (3, 1), (3, 3), (3, 4)
};
CollectionAssert.AreEqual(
expected,
- results,
- "GetFreeSpot failed. Expected:\n{0}.\nActual:\n{1}",
- expected.ToArrayString(),
+ results,
+ "GetFreeSpot failed. Expected:\n{0}.\nActual:\n{1}",
+ expected.ToArrayString(),
results.ToArrayString());
}
@@ -58,13 +57,13 @@ public void Test_UniformGrid_GetFreeSpots_FirstColumn()
var results = UniformGrid.GetFreeSpot(testref, 2, false).ToArray();
- var expected = new(int row, int column)[]
- {
- (0, 2), (0, 4),
- (1, 0), (1, 4),
- (2, 0), (2, 4),
- (3, 0),(3, 1), (3, 3),(3, 4)
- };
+ var expected = new (int row, int column)[]
+ {
+ (0, 2), (0, 4),
+ (1, 0), (1, 4),
+ (2, 0), (2, 4),
+ (3, 0), (3, 1), (3, 3), (3, 4)
+ };
CollectionAssert.AreEqual(
expected,
@@ -87,11 +86,11 @@ public void Test_UniformGrid_GetFreeSpots_FirstColumnEndBoundMinusOne()
var results = UniformGrid.GetFreeSpot(testref, 2, false).ToArray();
- var expected = new(int row, int column)[]
+ var expected = new (int row, int column)[]
{
(0, 2),
- (1, 0),(1, 1),(1, 2),
- (2, 0),(2, 1),(2, 2),
+ (1, 0), (1, 1), (1, 2),
+ (2, 0), (2, 1), (2, 2),
};
CollectionAssert.AreEqual(
@@ -115,11 +114,11 @@ public void Test_UniformGrid_GetFreeSpots_FirstColumnEndBound()
var results = UniformGrid.GetFreeSpot(testref, 3, false).ToArray();
- var expected = new(int row, int column)[]
+ var expected = new (int row, int column)[]
{
- (0, 0),(0, 1),(0, 2),
- (1, 0),(1, 1),(1, 2),
- (2, 0),(2, 1),(2, 2),
+ (0, 0), (0, 1), (0, 2),
+ (1, 0), (1, 1), (1, 2),
+ (2, 0), (2, 1), (2, 2),
};
CollectionAssert.AreEqual(
@@ -143,11 +142,11 @@ public void Test_UniformGrid_GetFreeSpots_FirstColumnEndBound_TopDown()
var results = UniformGrid.GetFreeSpot(testref, 3, true).ToArray();
- var expected = new(int row, int column)[]
+ var expected = new (int row, int column)[]
{
- (0, 0),(1, 0),(2, 0),
- (0, 1),(1, 1),(2, 1),
- (0, 2),(1, 2),(2, 2),
+ (0, 0), (1, 0), (2, 0),
+ (0, 1), (1, 1), (2, 1),
+ (0, 2), (1, 2), (2, 2),
};
CollectionAssert.AreEqual(
@@ -173,13 +172,13 @@ public void Test_UniformGrid_GetFreeSpots_VerticalOrientation()
var results = UniformGrid.GetFreeSpot(testref, 0, true).ToArray();
// top-bottom, transpose of matrix above.
- var expected = new(int row, int column)[]
+ var expected = new (int row, int column)[]
{
- (0, 0),(1, 0), (3, 0),
- (0, 1), (2, 1),(3, 1),
- (0, 2), (2, 2),
- (1, 3), (3, 3),
- (0, 4),(1, 4),(2, 4),(3, 4)
+ (0, 0), (1, 0), (3, 0),
+ (0, 1), (2, 1), (3, 1),
+ (0, 2), (2, 2),
+ (1, 3), (3, 3),
+ (0, 4), (1, 4), (2, 4), (3, 4)
};
CollectionAssert.AreEqual(
@@ -190,5 +189,4 @@ public void Test_UniformGrid_GetFreeSpots_VerticalOrientation()
results.ToArrayString());
}
}
- #pragma warning restore SA1008 // Opening parenthesis must be spaced correctly
}
\ No newline at end of file
diff --git a/UnitTests/UI/Controls/Test_UniformGrid_RowColDefinitions.cs b/UnitTests/UI/Controls/Test_UniformGrid_RowColDefinitions.cs
index b2926ed27f2..6b68556f2cd 100644
--- a/UnitTests/UI/Controls/Test_UniformGrid_RowColDefinitions.cs
+++ b/UnitTests/UI/Controls/Test_UniformGrid_RowColDefinitions.cs
@@ -12,7 +12,6 @@
namespace UnitTests.UI.Controls
{
[TestClass]
- #pragma warning disable SA1008 // Opening parenthesis must be spaced correctly
public class Test_UniformGrid_RowColDefinitions
{
[TestCategory("UniformGrid")]
@@ -810,5 +809,4 @@ public void Test_UniformGrid_SetupColumnDefinitions_FirstAndEndFixed()
}
}
}
- #pragma warning restore SA1008 // Opening parenthesis must be spaced correctly
}
\ No newline at end of file
diff --git a/UnitTests/UnitTests.Notifications.Shared/AssertHelper.cs b/UnitTests/UnitTests.Notifications.Shared/TestAssertHelper.cs
similarity index 73%
rename from UnitTests/UnitTests.Notifications.Shared/AssertHelper.cs
rename to UnitTests/UnitTests.Notifications.Shared/TestAssertHelper.cs
index 604370abdf8..a85845dda7f 100644
--- a/UnitTests/UnitTests.Notifications.Shared/AssertHelper.cs
+++ b/UnitTests/UnitTests.Notifications.Shared/TestAssertHelper.cs
@@ -2,13 +2,13 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-using Microsoft.Toolkit.Uwp.Notifications;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Xml;
+using Microsoft.Toolkit.Uwp.Notifications;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace UnitTests.Notifications
{
@@ -28,7 +28,10 @@ public void TestAssertXmlElement_002()
{
AssertHelper.AssertXml(" Hello world", " Hello world ");
}
- catch { return; }
+ catch
+ {
+ return;
+ }
Assert.Fail("tile element name was different, should have thrown exception");
}
@@ -40,7 +43,10 @@ public void TestAssertXmlElement_003()
{
AssertHelper.AssertXml(" Hello world", " Hello world ");
}
- catch { return; }
+ catch
+ {
+ return;
+ }
Assert.Fail("visual element name was incorrect, should have thrown exception");
}
@@ -52,7 +58,10 @@ public void TestAssertXmlElement_004()
{
AssertHelper.AssertXml(" Hello world", " Hello world ");
}
- catch { return; }
+ catch
+ {
+ return;
+ }
Assert.Fail("visual version number was incorrect, should have thrown exception");
}
@@ -64,7 +73,10 @@ public void TestAssertXmlElement_005()
{
AssertHelper.AssertXml(" Hello world", " Hello world! ");
}
- catch { return; }
+ catch
+ {
+ return;
+ }
Assert.Fail("text content was different, should have thrown exception");
}
@@ -82,7 +94,10 @@ public void TestAssertXmlElement_006_1()
{
AssertHelper.AssertXml("", "");
}
- catch { return; }
+ catch
+ {
+ return;
+ }
Assert.Fail("Version number was incorrect, should have thrown exception.");
}
@@ -94,7 +109,10 @@ public void TestAssertXmlElement_006_2()
{
AssertHelper.AssertXml("", "");
}
- catch { return; }
+ catch
+ {
+ return;
+ }
Assert.Fail("ID number was incorrect, should have thrown exception.");
}
@@ -114,7 +132,10 @@ public void TestAssertXmlElement_008()
{
AssertHelper.AssertXml("", "");
}
- catch { return; }
+ catch
+ {
+ return;
+ }
Assert.Fail("Visual element was missing, should have thrown exception");
}
@@ -128,7 +149,10 @@ public void TestAssertXmlElement_009()
{
AssertHelper.AssertXml("", "");
}
- catch { return; }
+ catch
+ {
+ return;
+ }
Assert.Fail("Child elements were different order, should have thrown exception");
}
@@ -140,7 +164,10 @@ public void TestAssertXmlElement_010()
{
AssertHelper.AssertXml("", "");
}
- catch { return; }
+ catch
+ {
+ return;
+ }
Assert.Fail("id attribute value wasn't the same, should have thrown exception");
}
@@ -152,89 +179,93 @@ public void TestAssertXmlElement_011()
{
AssertHelper.AssertXml("", "");
}
- catch { return; }
+ catch
+ {
+ return;
+ }
Assert.Fail("id attribute was missing, should have thrown exception");
}
}
+#pragma warning disable SA1204 // Static elements should appear before instance elements
+#pragma warning disable SA1402 // File may only contain a single type
public static class AssertHelper
+#pragma warning restore SA1402 // File may only contain a single type
+#pragma warning restore SA1204 // Static elements should appear before instance elements
{
private class XmlElementHelper
{
}
- //public static void AssertXml(string expected, string actual)
- //{
- // XmlDocument expectedDoc = new XmlDocument();
- // expectedDoc.LoadXml(expected);
-
- // XmlDocument actualDoc = new XmlDocument();
- // actualDoc.LoadXml(actual);
-
- // AssertXmlElement(expectedDoc.DocumentElement, actualDoc.DocumentElement);
- //}
-
- //private static void AssertXmlElement(XmlElement expected, XmlElement actual)
- //{
- // // If both null, good, done
- // if (expected == null && actual == null)
- // return;
-
- // // If one is null and other isn't, bad
- // if (expected == null)
- // Assert.Fail("Expected XML element was null, while actual was initialized");
-
- // if (actual == null)
- // Assert.Fail("Actual XML element was null, while expected was initialized");
+ /*
+ public static void AssertXml(string expected, string actual)
+ {
+ XmlDocument expectedDoc = new XmlDocument();
+ expectedDoc.LoadXml(expected);
+ XmlDocument actualDoc = new XmlDocument();
+ actualDoc.LoadXml(actual);
- // // If name doesn't match
- // Assert.AreEqual(expected.Name, actual.Name, "Element names did not match.");
+ AssertXmlElement(expectedDoc.DocumentElement, actualDoc.DocumentElement);
+ }
+ private static void AssertXmlElement(XmlElement expected, XmlElement actual)
+ {
+ // If both null, good, done
+ if (expected == null && actual == null)
+ return;
- // // If attribute count doesn't match
- // Assert.AreEqual(expected.Attributes.Count, actual.Attributes.Count, "Element attributes counts didn't match");
+ // If one is null and other isn't, bad
+ if (expected == null)
+ Assert.Fail("Expected XML element was null, while actual was initialized");
+ if (actual == null)
+ Assert.Fail("Actual XML element was null, while expected was initialized");
- // // Make sure attributes match (order does NOT matter)
- // foreach (XmlAttribute expectedAttr in expected.Attributes)
- // {
- // var actualAttr = actual.Attributes.GetNamedItem(expectedAttr.Name);
+ // If name doesn't match
+ Assert.AreEqual(expected.Name, actual.Name, "Element names did not match.");
- // // If didn't find the attribute
- // if (actualAttr == null)
- // Assert.Fail("Expected element to have attribute " + expectedAttr.Name + " but it didn't.");
+ // If attribute count doesn't match
+ Assert.AreEqual(expected.Attributes.Count, actual.Attributes.Count, "Element attributes counts didn't match");
- // // Make sure value matches
- // Assert.AreEqual(expectedAttr.Value, actualAttr.Value, $@"Attribute values for ""{expectedAttr.Name}"" didn't match.");
- // }
+ // Make sure attributes match (order does NOT matter)
+ foreach (XmlAttribute expectedAttr in expected.Attributes)
+ {
+ var actualAttr = actual.Attributes.GetNamedItem(expectedAttr.Name);
+ // If didn't find the attribute
+ if (actualAttr == null)
+ Assert.Fail("Expected element to have attribute " + expectedAttr.Name + " but it didn't.");
- // // Make sure children elements match (order DOES matter)
+ // Make sure value matches
+ Assert.AreEqual(expectedAttr.Value, actualAttr.Value, $@"Attribute values for ""{expectedAttr.Name}"" didn't match.");
+ }
- // // Obtain the child elements (ignore any comments, w
- // XmlElement[] expectedChildren = expected.ChildNodes.OfType().ToArray();
- // XmlElement[] actualChildren = actual.ChildNodes.OfType().ToArray();
+ // Make sure children elements match (order DOES matter)
- // Assert.AreEqual(expectedChildren.Length, actualChildren.Length, "Number of child elements did not match.");
+ // Obtain the child elements (ignore any comments, w
+ XmlElement[] expectedChildren = expected.ChildNodes.OfType().ToArray();
+ XmlElement[] actualChildren = actual.ChildNodes.OfType().ToArray();
+ Assert.AreEqual(expectedChildren.Length, actualChildren.Length, "Number of child elements did not match.");
- // // If no elements, compare inner text
- // if (expectedChildren.Length == 0)
- // {
- // Assert.AreEqual(expected.InnerText, actual.InnerText, "Inner text did not match.");
- // }
+ // If no elements, compare inner text
+ if (expectedChildren.Length == 0)
+ {
+ Assert.AreEqual(expected.InnerText, actual.InnerText, "Inner text did not match.");
+ }
- // // Otherwise compare elements
- // else
- // {
- // for (int i = 0; i < expectedChildren.Length; i++)
- // {
- // AssertXmlElement(expectedChildren[i], actualChildren[i]);
- // }
- // }
- //}
+ // Otherwise compare elements
+ else
+ {
+ for (int i = 0; i < expectedChildren.Length; i++)
+ {
+ AssertXmlElement(expectedChildren[i], actualChildren[i]);
+ }
+ }
+ }
+ */
public static void AssertToast(string expected, ToastContent toast)
{
@@ -273,24 +304,27 @@ private static void AssertXmlElement(MyXmlElement expected, MyXmlElement actual)
{
// If both null, good, done
if (expected == null && actual == null)
+ {
return;
+ }
// If one is null and other isn't, bad
if (expected == null)
+ {
Assert.Fail("Expected XML element was null, while actual was initialized");
+ }
if (actual == null)
+ {
Assert.Fail("Actual XML element was null, while expected was initialized");
-
+ }
// If name doesn't match
Assert.AreEqual(expected.Name.ToLower(), actual.Name.ToLower(), "Element names did not match.");
-
// If attribute count doesn't match
Assert.AreEqual(expected.Attributes.Count, actual.Attributes.Count, $"Different number of attributes on <{expected.Name}>\n\nExpected: " + AttributesToString(expected.Attributes) + "\nActual: " + AttributesToString(actual.Attributes));
-
// Make sure attributes match (order does NOT matter)
foreach (MyXmlAttribute expectedAttr in expected.Attributes)
{
@@ -298,13 +332,14 @@ private static void AssertXmlElement(MyXmlElement expected, MyXmlElement actual)
// If didn't find the attribute
if (actualAttr == null)
+ {
Assert.Fail("Expected element to have attribute " + expectedAttr.Name + " but it didn't.");
+ }
// Make sure value matches
Assert.AreEqual(expectedAttr.Value.ToLower(), actualAttr.Value.ToLower(), $@"Attribute values for ""{expectedAttr.Name}"" didn't match.");
}
-
// Make sure children elements match (order DOES matter)
// Obtain the child elements (ignore any comments, w
@@ -313,7 +348,6 @@ private static void AssertXmlElement(MyXmlElement expected, MyXmlElement actual)
Assert.AreEqual(expectedChildren.Length, actualChildren.Length, "Number of child elements did not match.");
-
// Compare elements
for (int i = 0; i < expectedChildren.Length; i++)
{
@@ -333,6 +367,7 @@ private class MyXmlElement
private class MyXmlAttribute
{
public string Name { get; set; }
+
public string Value { get; set; }
}
@@ -347,10 +382,14 @@ private static MyXmlElement ParseXml(string xml)
while (true)
{
if (reader.ReadState == ReadState.EndOfFile)
+ {
break;
+ }
if (reader.ReadState == ReadState.Error)
+ {
throw new Exception("ReadState was Error");
+ }
if (reader.NodeType == XmlNodeType.Element)
{
@@ -385,7 +424,9 @@ private static void PopulateElement(XmlReader reader, MyXmlElement into)
private static void ParseXml(XmlReader reader, MyXmlElement intoElement)
{
if (!reader.Read())
+ {
return;
+ }
while (true)
{
@@ -400,14 +441,15 @@ private static void ParseXml(XmlReader reader, MyXmlElement intoElement)
intoElement.ChildNodes.Add(child);
break;
-
// All done
case XmlNodeType.EndElement:
return;
}
if (!reader.Read())
+ {
return;
+ }
}
}
}
diff --git a/UnitTests/UnitTests.Notifications.Shared/TestMail.cs b/UnitTests/UnitTests.Notifications.Shared/TestMail.cs
index 96add14c76e..c9dfb1eeed8 100644
--- a/UnitTests/UnitTests.Notifications.Shared/TestMail.cs
+++ b/UnitTests/UnitTests.Notifications.Shared/TestMail.cs
@@ -2,8 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.Toolkit.Uwp.Notifications;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace UnitTests.Notifications
{
@@ -30,7 +30,6 @@ public void TestMailTile()
}
};
-
TileBinding medium = new TileBinding()
{
Branding = TileBranding.Logo,
@@ -46,7 +45,6 @@ public void TestMailTile()
}
};
-
TileBinding wideAndLarge = new TileBinding()
{
Branding = TileBranding.NameAndLogo,
@@ -62,8 +60,6 @@ public void TestMailTile()
}
};
-
-
TileContent content = new TileContent()
{
Visual = new TileVisual()
@@ -77,19 +73,16 @@ public void TestMailTile()
string expectedXml = $@"";
-
// Medium
expectedXml += @"";
expectedXml += GenerateXmlGroups(false);
expectedXml += "";
-
// Wide
expectedXml += @"";
expectedXml += GenerateXmlGroups(true);
expectedXml += "";
-
// Large
expectedXml += @"";
expectedXml += GenerateXmlGroups(true);
@@ -97,13 +90,9 @@ public void TestMailTile()
expectedXml += "";
-
-
-
AssertHelper.AssertTile(expectedXml, content);
}
-
private static string GenerateXmlGroups(bool makeLarge)
{
return GenerateXmlGroup(FirstFrom, FirstSubject, FirstBody, makeLarge) + "" + GenerateXmlGroup(SecondFrom, SecondSubject, SecondBody, makeLarge);
@@ -114,9 +103,13 @@ private static string GenerateXmlGroup(string from, string subject, string body,
string xml = "{from}{subject}{body}";
diff --git a/UnitTests/UnitTests.Notifications.Shared/TestToastContentBuilder.cs b/UnitTests/UnitTests.Notifications.Shared/TestToastContentBuilder.cs
index 9aacfab13a1..83a28ef286c 100644
--- a/UnitTests/UnitTests.Notifications.Shared/TestToastContentBuilder.cs
+++ b/UnitTests/UnitTests.Notifications.Shared/TestToastContentBuilder.cs
@@ -2,10 +2,10 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-using Microsoft.Toolkit.Uwp.Notifications;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Linq;
+using Microsoft.Toolkit.Uwp.Notifications;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace UnitTests.Notifications
{
@@ -260,7 +260,7 @@ public void AddInlineImageTest_WithInlineImageAndFullOptions_ReturnSelfWithInlin
// Assert
Assert.AreSame(builder, anotherReference);
- var image = (builder.Content.Visual.BindingGeneric.Children.First() as AdaptiveImage);
+ var image = builder.Content.Visual.BindingGeneric.Children.First() as AdaptiveImage;
Assert.AreEqual(testInlineImageUriSrc.OriginalString, image.Source);
Assert.AreEqual(testInlineImageAltText, image.AlternateText);
@@ -278,7 +278,7 @@ public void AddProgressBarTest_WithoutInputArgs_ReturnSelfWithNonIndeterminateBi
// Assert
Assert.AreSame(builder, anotherReference);
- var progressBar = (builder.Content.Visual.BindingGeneric.Children.First() as AdaptiveProgressBar);
+ var progressBar = builder.Content.Visual.BindingGeneric.Children.First() as AdaptiveProgressBar;
Assert.IsNotNull(progressBar.Title.BindingName);
Assert.IsNotNull(progressBar.Value.BindingName);
@@ -302,7 +302,7 @@ public void AddProgressBarTest_WithFixedPropertiesAndDeterminateValue_ReturnSelf
// Assert
Assert.AreSame(builder, anotherReference);
- var progressBar = (builder.Content.Visual.BindingGeneric.Children.First() as AdaptiveProgressBar);
+ var progressBar = builder.Content.Visual.BindingGeneric.Children.First() as AdaptiveProgressBar;
Assert.IsNull(progressBar.Title.BindingName);
Assert.AreEqual(testProgressBarTitle, (string)progressBar.Title);
@@ -328,7 +328,7 @@ public void AddProgressBarTest_WithIndeterminateValue_ReturnSelfWithIndeterminat
// Assert
Assert.AreSame(builder, anotherReference);
- var progressBar = (builder.Content.Visual.BindingGeneric.Children.First() as AdaptiveProgressBar);
+ var progressBar = builder.Content.Visual.BindingGeneric.Children.First() as AdaptiveProgressBar;
Assert.IsTrue(((AdaptiveProgressBarValue)progressBar.Value).IsIndeterminate);
}
@@ -345,7 +345,7 @@ public void AddTextTest_WithSimpleText_ReturnSelfWithTextAdded()
// Assert
Assert.AreSame(builder, anotherReference);
- var text = (builder.Content.Visual.BindingGeneric.Children.First() as AdaptiveText);
+ var text = builder.Content.Visual.BindingGeneric.Children.First() as AdaptiveText;
Assert.AreEqual(testText, (string)text.Text);
}
@@ -368,9 +368,9 @@ public void AddTextTest_WithMultipleTexts_ReturnSelfWithAllTextsAdded()
Assert.AreSame(builder, anotherReference);
var texts = builder.Content.Visual.BindingGeneric.Children.Take(3).Cast().ToList();
- Assert.AreEqual(testText1, (string)(texts[0].Text));
- Assert.AreEqual(testText2, (string)(texts[1].Text));
- Assert.AreEqual(testText3, (string)(texts[2].Text));
+ Assert.AreEqual(testText1, (string)texts[0].Text);
+ Assert.AreEqual(testText2, (string)texts[1].Text);
+ Assert.AreEqual(testText3, (string)texts[2].Text);
}
[TestMethod]
@@ -392,7 +392,7 @@ public void AddTextTest_WithTextAndFullOptions_ReturnSelfWithTextAndAllOptionsAd
// Assert
Assert.AreSame(builder, anotherReference);
- var text = (builder.Content.Visual.BindingGeneric.Children.First() as AdaptiveText);
+ var text = builder.Content.Visual.BindingGeneric.Children.First() as AdaptiveText;
Assert.AreEqual(testText, (string)text.Text);
Assert.AreEqual(testStyle, text.HintStyle);
diff --git a/UnitTests/UnitTests.Notifications.Shared/TestWeather.cs b/UnitTests/UnitTests.Notifications.Shared/TestWeather.cs
index fd4c5b0a017..20050b264db 100644
--- a/UnitTests/UnitTests.Notifications.Shared/TestWeather.cs
+++ b/UnitTests/UnitTests.Notifications.Shared/TestWeather.cs
@@ -2,8 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.Toolkit.Uwp.Notifications;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace UnitTests.Notifications
{
@@ -212,7 +212,7 @@ public void TestWeatherTile()
expectedPayload += GenerateStringLargeSubgroup("Fri", ImageSunny, 71, 66);
expectedPayload += "";
-
+
AssertHelper.AssertTile(expectedPayload, content);
}
diff --git a/UnitTests/UnitTests.Notifications.Shared/Test_Adaptive_Xml.cs b/UnitTests/UnitTests.Notifications.Shared/Test_Adaptive_Xml.cs
index 1c9654f4f33..53fa51fa9f5 100644
--- a/UnitTests/UnitTests.Notifications.Shared/Test_Adaptive_Xml.cs
+++ b/UnitTests/UnitTests.Notifications.Shared/Test_Adaptive_Xml.cs
@@ -2,9 +2,9 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-using Microsoft.Toolkit.Uwp.Notifications;
using System;
+using Microsoft.Toolkit.Uwp.Notifications;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace UnitTests.Notifications
{
@@ -38,7 +38,7 @@ public void Test_Adaptive_Text_Text()
#endif
});
}
-
+
[TestMethod]
public void Test_Adaptive_Text_HintStyle_Values()
{
@@ -77,7 +77,7 @@ public void Test_Adaptive_Text_HintAlign_Values()
AssertAdaptiveTextAlign("center", AdaptiveTextAlign.Center);
AssertAdaptiveTextAlign("right", AdaptiveTextAlign.Right);
}
-
+
private static void AssertAdaptiveTextAlign(string expectedPropertyValue, AdaptiveTextAlign align)
{
AssertAdaptiveTextPropertyValue("hint-align", expectedPropertyValue, new AdaptiveText()
@@ -116,19 +116,21 @@ public void Test_Adaptive_Text_HintMaxLines_MaxValue()
[TestMethod]
public void Test_Adaptive_Text_HintMaxLines_BelowMin()
{
- Assert.ThrowsException(() =>
- {
- new AdaptiveText() { HintMaxLines = 0 };
- }, "ArgumentOutOfRangeExceptions should have been thrown.");
+ Assert.ThrowsException(
+ () =>
+ {
+ new AdaptiveText() { HintMaxLines = 0 };
+ }, "ArgumentOutOfRangeExceptions should have been thrown.");
}
[TestMethod]
public void Test_Adaptive_Text_HintMaxLines_AboveMax()
{
- Assert.ThrowsException(() =>
- {
- new AdaptiveText() { HintMaxLines = -54 };
- }, "ArgumentOutOfRangeExceptions should have been thrown.");
+ Assert.ThrowsException(
+ () =>
+ {
+ new AdaptiveText() { HintMaxLines = -54 };
+ }, "ArgumentOutOfRangeExceptions should have been thrown.");
}
[TestMethod]
@@ -161,19 +163,21 @@ public void Test_Adaptive_Text_HintMinLines_MaxValue()
[TestMethod]
public void Test_Adaptive_Text_HintMinLines_BelowMin()
{
- Assert.ThrowsException(() =>
- {
- new AdaptiveText() { HintMinLines = 0 };
- }, "ArgumentOutOfRangeExceptions should have been thrown.");
+ Assert.ThrowsException(
+ () =>
+ {
+ new AdaptiveText() { HintMinLines = 0 };
+ }, "ArgumentOutOfRangeExceptions should have been thrown.");
}
[TestMethod]
public void Test_Adaptive_Text_HintMinLines_AboveMax()
{
- Assert.ThrowsException(() =>
- {
- new AdaptiveText() { HintMinLines = -54 };
- }, "ArgumentOutOfRangeExceptions should have been thrown.");
+ Assert.ThrowsException(
+ () =>
+ {
+ new AdaptiveText() { HintMinLines = -54 };
+ }, "ArgumentOutOfRangeExceptions should have been thrown.");
}
[TestMethod]
@@ -213,10 +217,11 @@ private static void AssertAdaptiveTextPropertyValue(string expectedPropertyName,
[TestMethod]
public void Test_Adaptive_Image_Defaults()
{
- Assert.ThrowsException(() =>
- {
- AssertAdaptiveChild("exception should be thrown", new AdaptiveImage());
- }, "NullReferenceException should have been thrown.");
+ Assert.ThrowsException(
+ () =>
+ {
+ AssertAdaptiveChild("exception should be thrown", new AdaptiveImage());
+ }, "NullReferenceException should have been thrown.");
}
[TestMethod]
@@ -246,13 +251,14 @@ public void Test_Adaptive_Image_Source()
[TestMethod]
public void Test_Adaptive_Image_Source_Null()
{
- Assert.ThrowsException(() =>
- {
- new AdaptiveImage()
+ Assert.ThrowsException(
+ () =>
{
- Source = null
- };
- }, "ArgumentNullException should have been thrown.");
+ new AdaptiveImage()
+ {
+ Source = null
+ };
+ }, "ArgumentNullException should have been thrown.");
}
[TestMethod]
@@ -350,7 +356,9 @@ private static void AssertAdaptiveImagePropertyValue(string expectedPropertyName
string xml = $"";
@@ -360,10 +368,11 @@ private static void AssertAdaptiveImagePropertyValue(string expectedPropertyName
[TestMethod]
public void Test_Adaptive_Group_Defaults()
{
- Assert.ThrowsException(() =>
- {
- AssertAdaptiveChild("exception should be thrown since groups need at least one subgroup child", new AdaptiveGroup());
- }, "InvalidOperationException should have been thrown.");
+ Assert.ThrowsException(
+ () =>
+ {
+ AssertAdaptiveChild("exception should be thrown since groups need at least one subgroup child", new AdaptiveGroup());
+ }, "InvalidOperationException should have been thrown.");
}
[TestMethod]
@@ -441,25 +450,27 @@ public void Test_Adaptive_Subgroup_HintWeight_MaxValue()
[TestMethod]
public void Test_Adaptive_Subgroup_HintWeight_JustBelowMin()
{
- Assert.ThrowsException(() =>
- {
- AssertAdaptiveSubgroup("exception should be thrown", new AdaptiveSubgroup()
+ Assert.ThrowsException(
+ () =>
{
- HintWeight = 0
- });
- }, "ArgumentOutOfRangeException should have been thrown.");
+ AssertAdaptiveSubgroup("exception should be thrown", new AdaptiveSubgroup()
+ {
+ HintWeight = 0
+ });
+ }, "ArgumentOutOfRangeException should have been thrown.");
}
[TestMethod]
public void Test_Adaptive_Subgroup_HintWeight_BelowMin()
{
- Assert.ThrowsException(() =>
- {
- AssertAdaptiveSubgroup("exception should be thrown", new AdaptiveSubgroup()
+ Assert.ThrowsException(
+ () =>
{
- HintWeight = -53
- });
- }, "ArgumentOutOfRangeException should have been thrown.");
+ AssertAdaptiveSubgroup("exception should be thrown", new AdaptiveSubgroup()
+ {
+ HintWeight = -53
+ });
+ }, "ArgumentOutOfRangeException should have been thrown.");
}
[TestMethod]
diff --git a/UnitTests/UnitTests.Notifications.Shared/Test_Badge_Xml.cs b/UnitTests/UnitTests.Notifications.Shared/Test_Badge_Xml.cs
index c68da6c67da..744138358dc 100644
--- a/UnitTests/UnitTests.Notifications.Shared/Test_Badge_Xml.cs
+++ b/UnitTests/UnitTests.Notifications.Shared/Test_Badge_Xml.cs
@@ -2,8 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.Toolkit.Uwp.Notifications;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace UnitTests.Notifications
{
diff --git a/UnitTests/UnitTests.Notifications.Shared/Test_Tile_Xml.cs b/UnitTests/UnitTests.Notifications.Shared/Test_Tile_Xml.cs
index 10cdbefc471..711923a9a5e 100644
--- a/UnitTests/UnitTests.Notifications.Shared/Test_Tile_Xml.cs
+++ b/UnitTests/UnitTests.Notifications.Shared/Test_Tile_Xml.cs
@@ -11,9 +11,6 @@ namespace UnitTests.Notifications
[TestClass]
public class Test_Tile_Xml
{
-
-#region Tile
-
[TestMethod]
public void Test_Tile_Xml_Tile_Default()
{
@@ -21,216 +18,173 @@ public void Test_Tile_Xml_Tile_Default()
AssertPayload("", tile);
}
-
+
[TestMethod]
public void Test_Tile_Xml_Visual_Default()
{
// Assert the defaults
AssertVisual("", new TileVisual());
}
-
+
[TestMethod]
public void Test_Tile_Xml_Visual_AddImageQuery_False()
{
AssertVisual(
-
"",
-
new TileVisual()
{
AddImageQuery = false
});
}
-
+
[TestMethod]
public void Test_Tile_Xml_Visual_AddImageQuery_True()
{
AssertVisual(
-
"",
-
new TileVisual()
{
AddImageQuery = true
});
}
-
[TestMethod]
public void Test_Tile_Xml_Visual_BaseUri_Null()
{
AssertVisual(
-
"",
-
new TileVisual()
{
BaseUri = null
});
}
-
[TestMethod]
public void Test_Tile_Xml_Visual_BaseUri_Value()
{
AssertVisual(
-
"",
-
new TileVisual()
{
BaseUri = new Uri("http://msn.com")
});
}
-
[TestMethod]
public void Test_Tile_Xml_Visual_Branding_Auto()
{
AssertVisual(
-
"",
-
new TileVisual()
{
Branding = TileBranding.Auto
});
}
-
[TestMethod]
public void Test_Tile_Xml_Visual_Branding_Name()
{
AssertVisual(
-
"",
-
new TileVisual()
{
Branding = TileBranding.Name
});
}
-
[TestMethod]
public void Test_Tile_Xml_Visual_Branding_Logo()
{
AssertVisual(
-
"",
-
new TileVisual()
{
Branding = TileBranding.Logo
});
}
-
[TestMethod]
public void Test_Tile_Xml_Visual_Branding_NameAndLogo()
{
AssertVisual(
-
"",
-
new TileVisual()
{
Branding = TileBranding.NameAndLogo
});
}
-
[TestMethod]
public void Test_Tile_Xml_Visual_Branding_None()
{
AssertVisual(
-
"",
-
new TileVisual()
{
Branding = TileBranding.None
});
}
-
[TestMethod]
public void Test_Tile_Xml_Visual_ContentId_Null()
{
AssertVisual(
-
"",
-
new TileVisual()
{
ContentId = null
});
}
-
[TestMethod]
public void Test_Tile_Xml_Visual_ContentId_Value()
{
AssertVisual(
-
"",
-
new TileVisual()
- {
+ {
ContentId = "tsla"
});
}
-
[TestMethod]
public void Test_Tile_Xml_Visual_DisplayName_Null()
{
AssertVisual(
-
"",
-
new TileVisual()
{
DisplayName = null
});
}
-
[TestMethod]
public void Test_Tile_Xml_Visual_DisplayName_Value()
{
AssertVisual(
-
"",
-
new TileVisual()
{
DisplayName = "My name"
});
}
-
[TestMethod]
public void Test_Tile_Xml_Visual_Language_Null()
{
AssertVisual(
-
"",
-
new TileVisual()
{
Language = null
});
}
-
[TestMethod]
public void Test_Tile_Xml_Visual_Language_Value()
{
AssertVisual(
-
"",
-
new TileVisual()
{
Language = "en-US"
@@ -241,51 +195,40 @@ public void Test_Tile_Xml_Visual_Language_Value()
public void Test_Tile_Xml_Visual_Arguments_Null()
{
AssertVisual(
-
"",
-
new TileVisual()
{
Arguments = null
});
}
-
[TestMethod]
public void Test_Tile_Xml_Visual_Arguments_EmptyString()
{
AssertVisual(
-
"",
-
new TileVisual()
{
- Arguments = ""
+ Arguments = string.Empty
});
}
-
[TestMethod]
public void Test_Tile_Xml_Visual_Arguments_Value()
{
AssertVisual(
-
"",
-
new TileVisual()
{
Arguments = "action=viewStory&story=53"
});
}
-
[TestMethod]
public void Test_Tile_Xml_Visual_LockDetailedStatus1_NoMatchingText()
{
AssertVisual(
-
"AwesomeCool",
-
new TileVisual()
{
LockDetailedStatus1 = "Status 1",
@@ -301,19 +244,14 @@ public void Test_Tile_Xml_Visual_LockDetailedStatus1_NoMatchingText()
}
}
}
- }
-
- );
+ });
}
-
[TestMethod]
public void Test_Tile_Xml_Visual_LockDetailedStatus1_MatchingText_InBinding()
{
AssertVisual(
-
"AwesomeCoolStatus 1Blah",
-
new TileVisual()
{
LockDetailedStatus1 = "Status 1",
@@ -331,22 +269,16 @@ public void Test_Tile_Xml_Visual_LockDetailedStatus1_MatchingText_InBinding()
}
}
}
- }
-
- );
+ });
}
-
[TestMethod]
public void Test_Tile_Xml_Visual_LockDetailedStatus1_MatchingText_InSubgroup()
{
- /// The lockscreen only looks at ID's in the immediate binding children. So anything in the groups/subgroups are
- /// ignored. Thus, if text matches there, it still has to be placed as a hint.
-
+ // The lockscreen only looks at ID's in the immediate binding children. So anything in the groups/subgroups are
+ // ignored. Thus, if text matches there, it still has to be placed as a hint.
AssertVisual(
-
"AwesomeStatus 1CoolBlah",
-
new TileVisual()
{
LockDetailedStatus1 = "Status 1",
@@ -380,19 +312,14 @@ public void Test_Tile_Xml_Visual_LockDetailedStatus1_MatchingText_InSubgroup()
}
}
}
- }
-
- );
+ });
}
-
[TestMethod]
public void Test_Tile_Xml_Visual_LockDetailedStatus2_NoMatchingText()
{
AssertVisual(
-
"AwesomeCool",
-
new TileVisual()
{
LockDetailedStatus2 = "Status 2",
@@ -408,19 +335,14 @@ public void Test_Tile_Xml_Visual_LockDetailedStatus2_NoMatchingText()
}
}
}
- }
-
- );
+ });
}
-
[TestMethod]
public void Test_Tile_Xml_Visual_LockDetailedStatus2_MatchingText_InBinding()
{
AssertVisual(
-
"AwesomeCoolStatus 2Blah",
-
new TileVisual()
{
LockDetailedStatus2 = "Status 2",
@@ -438,19 +360,14 @@ public void Test_Tile_Xml_Visual_LockDetailedStatus2_MatchingText_InBinding()
}
}
}
- }
-
- );
+ });
}
-
[TestMethod]
public void Test_Tile_Xml_Visual_LockDetailedStatus2_MatchingText_InSubgroup()
{
AssertVisual(
-
"AwesomeStatus 2CoolBlah",
-
new TileVisual()
{
LockDetailedStatus2 = "Status 2",
@@ -484,19 +401,14 @@ public void Test_Tile_Xml_Visual_LockDetailedStatus2_MatchingText_InSubgroup()
}
}
}
- }
-
- );
+ });
}
-
[TestMethod]
public void Test_Tile_Xml_Visual_LockDetailedStatus3_NoMatchingText()
{
AssertVisual(
-
"AwesomeCool",
-
new TileVisual()
{
LockDetailedStatus3 = "Status 3",
@@ -512,19 +424,14 @@ public void Test_Tile_Xml_Visual_LockDetailedStatus3_NoMatchingText()
}
}
}
- }
-
- );
+ });
}
-
[TestMethod]
public void Test_Tile_Xml_Visual_LockDetailedStatus3_MatchingText_InBinding()
{
AssertVisual(
-
"AwesomeCoolStatus 3Blah",
-
new TileVisual()
{
LockDetailedStatus3 = "Status 3",
@@ -542,19 +449,14 @@ public void Test_Tile_Xml_Visual_LockDetailedStatus3_MatchingText_InBinding()
}
}
}
- }
-
- );
+ });
}
-
[TestMethod]
public void Test_Tile_Xml_Visual_LockDetailedStatus3_MatchingText_InSubgroup()
{
AssertVisual(
-
"AwesomeStatus 3CoolBlah",
-
new TileVisual()
{
LockDetailedStatus3 = "Status 3",
@@ -588,18 +490,9 @@ public void Test_Tile_Xml_Visual_LockDetailedStatus3_MatchingText_InSubgroup()
}
}
}
- }
-
- );
+ });
}
-#endregion
-
-
-
-
-#region Binding
-
[TestMethod]
public void Test_Tile_Xml_Binding_Default()
{
@@ -610,9 +503,7 @@ public void Test_Tile_Xml_Binding_Default()
public void Test_Tile_Xml_Binding_AddImageQuery_False()
{
AssertBindingMedium(
-
"",
-
new TileBinding()
{
AddImageQuery = false
@@ -623,9 +514,7 @@ public void Test_Tile_Xml_Binding_AddImageQuery_False()
public void Test_Tile_Xml_Binding_AddImageQuery_True()
{
AssertBindingMedium(
-
"",
-
new TileBinding()
{
AddImageQuery = true
@@ -636,9 +525,7 @@ public void Test_Tile_Xml_Binding_AddImageQuery_True()
public void Test_Tile_Xml_Binding_BaseUri_Null()
{
AssertBindingMedium(
-
"",
-
new TileBinding()
{
BaseUri = null
@@ -649,9 +536,7 @@ public void Test_Tile_Xml_Binding_BaseUri_Null()
public void Test_Tile_Xml_Binding_BaseUri_Value()
{
AssertBindingMedium(
-
"",
-
new TileBinding()
{
BaseUri = new Uri("http://msn.com")
@@ -662,9 +547,7 @@ public void Test_Tile_Xml_Binding_BaseUri_Value()
public void Test_Tile_Xml_Binding_Branding_Auto()
{
AssertBindingMedium(
-
"",
-
new TileBinding()
{
Branding = TileBranding.Auto
@@ -675,9 +558,7 @@ public void Test_Tile_Xml_Binding_Branding_Auto()
public void Test_Tile_Xml_Binding_Branding_None()
{
AssertBindingMedium(
-
"",
-
new TileBinding()
{
Branding = TileBranding.None
@@ -688,9 +569,7 @@ public void Test_Tile_Xml_Binding_Branding_None()
public void Test_Tile_Xml_Binding_Branding_Name()
{
AssertBindingMedium(
-
"",
-
new TileBinding()
{
Branding = TileBranding.Name
@@ -701,9 +580,7 @@ public void Test_Tile_Xml_Binding_Branding_Name()
public void Test_Tile_Xml_Binding_Branding_Logo()
{
AssertBindingMedium(
-
"",
-
new TileBinding()
{
Branding = TileBranding.Logo
@@ -714,9 +591,7 @@ public void Test_Tile_Xml_Binding_Branding_Logo()
public void Test_Tile_Xml_Binding_Branding_NameAndLogo()
{
AssertBindingMedium(
-
"",
-
new TileBinding()
{
Branding = TileBranding.NameAndLogo
@@ -727,9 +602,7 @@ public void Test_Tile_Xml_Binding_Branding_NameAndLogo()
public void Test_Tile_Xml_Binding_ContentId_Null()
{
AssertBindingMedium(
-
"",
-
new TileBinding()
{
ContentId = null
@@ -740,9 +613,7 @@ public void Test_Tile_Xml_Binding_ContentId_Null()
public void Test_Tile_Xml_Binding_ContentId_Value()
{
AssertBindingMedium(
-
"",
-
new TileBinding()
{
ContentId = "myId"
@@ -753,9 +624,7 @@ public void Test_Tile_Xml_Binding_ContentId_Value()
public void Test_Tile_Xml_Binding_DisplayName_Null()
{
AssertBindingMedium(
-
"",
-
new TileBinding()
{
DisplayName = null
@@ -766,9 +635,7 @@ public void Test_Tile_Xml_Binding_DisplayName_Null()
public void Test_Tile_Xml_Binding_DisplayName_Value()
{
AssertBindingMedium(
-
"",
-
new TileBinding()
{
DisplayName = "My name"
@@ -779,9 +646,7 @@ public void Test_Tile_Xml_Binding_DisplayName_Value()
public void Test_Tile_Xml_Binding_Language_Null()
{
AssertBindingMedium(
-
"",
-
new TileBinding()
{
Language = null
@@ -792,22 +657,18 @@ public void Test_Tile_Xml_Binding_Language_Null()
public void Test_Tile_Xml_Binding_Language_Value()
{
AssertBindingMedium(
-
"",
-
new TileBinding()
{
Language = "en-US"
});
}
-
+
[TestMethod]
public void Test_Tile_Xml_Binding_Arguments_Null()
{
AssertBindingMedium(
-
"",
-
new TileBinding()
{
Arguments = null
@@ -818,12 +679,10 @@ public void Test_Tile_Xml_Binding_Arguments_Null()
public void Test_Tile_Xml_Binding_Arguments_EmptyString()
{
AssertBindingMedium(
-
"",
-
new TileBinding()
{
- Arguments = ""
+ Arguments = string.Empty
});
}
@@ -831,48 +690,29 @@ public void Test_Tile_Xml_Binding_Arguments_EmptyString()
public void Test_Tile_Xml_Binding_Arguments_Value()
{
AssertBindingMedium(
-
"",
-
new TileBinding()
{
Arguments = "action=viewStory&storyId=52"
});
}
-#endregion
-
-
-
-
-
-#region Adaptive
-
-
-#region Root
-
-
[TestMethod]
public void Test_Tile_Xml_Adaptive_Root_Defaults()
{
AssertBindingMedium(
-
"",
-
new TileBinding()
{
Content = new TileBindingContentAdaptive()
});
}
-
[TestMethod]
public void Test_Tile_Xml_Adaptive_Root_BackgroundImage_Value()
{
AssertBindingMedium(
-
"",
-
new TileBinding()
{
Content = new TileBindingContentAdaptive()
@@ -885,14 +725,11 @@ public void Test_Tile_Xml_Adaptive_Root_BackgroundImage_Value()
});
}
-
[TestMethod]
public void Test_Tile_Xml_Adaptive_Root_Overlay_Default()
{
AssertBindingMedium(
-
"",
-
new TileBinding()
{
Content = new TileBindingContentAdaptive()
@@ -906,14 +743,11 @@ public void Test_Tile_Xml_Adaptive_Root_Overlay_Default()
});
}
-
[TestMethod]
public void Test_Tile_Xml_Adaptive_Root_Overlay_Min()
{
AssertBindingMedium(
-
"",
-
new TileBinding()
{
Content = new TileBindingContentAdaptive()
@@ -927,14 +761,11 @@ public void Test_Tile_Xml_Adaptive_Root_Overlay_Min()
});
}
-
[TestMethod]
public void Test_Tile_Xml_Adaptive_Root_Overlay_Max()
{
AssertBindingMedium(
-
"",
-
new TileBinding()
{
Content = new TileBindingContentAdaptive()
@@ -948,14 +779,11 @@ public void Test_Tile_Xml_Adaptive_Root_Overlay_Max()
});
}
-
[TestMethod]
public void Test_Tile_Xml_Adaptive_Root_Overlay_AboveDefault()
{
AssertBindingMedium(
-
"",
-
new TileBinding()
{
Content = new TileBindingContentAdaptive()
@@ -969,14 +797,11 @@ public void Test_Tile_Xml_Adaptive_Root_Overlay_AboveDefault()
});
}
-
[TestMethod]
public void Test_Tile_Xml_Adaptive_Root_Overlay_BelowDefault()
{
AssertBindingMedium(
-
"",
-
new TileBinding()
{
Content = new TileBindingContentAdaptive()
@@ -990,7 +815,6 @@ public void Test_Tile_Xml_Adaptive_Root_Overlay_BelowDefault()
});
}
-
[TestMethod]
public void Test_Tile_Xml_BackgroundImage_Overlay_BelowMin()
{
@@ -1002,12 +826,14 @@ public void Test_Tile_Xml_BackgroundImage_Overlay_BelowMin()
Source = "Fable.jpg"
};
}
- catch { return; }
+ catch
+ {
+ return;
+ }
Assert.Fail("Exception should have been thrown.");
}
-
[TestMethod]
public void Test_Tile_Xml_Adaptive_Root_Overlay_AboveMax()
{
@@ -1019,19 +845,19 @@ public void Test_Tile_Xml_Adaptive_Root_Overlay_AboveMax()
Source = "Fable.jpg"
};
}
- catch { return; }
+ catch
+ {
+ return;
+ }
Assert.Fail("Exception should have been thrown.");
}
-
[TestMethod]
public void Test_Tile_Xml_Adaptive_Root_PeekImage_Value()
{
AssertBindingMedium(
-
"",
-
new TileBinding()
{
Content = new TileBindingContentAdaptive()
@@ -1046,14 +872,11 @@ public void Test_Tile_Xml_Adaptive_Root_PeekImage_Value()
});
}
-
[TestMethod]
public void Test_Tile_Xml_Adaptive_Root_TextStacking_Top()
{
AssertBindingMedium(
-
"",
-
new TileBinding()
{
Content = new TileBindingContentAdaptive()
@@ -1063,14 +886,11 @@ public void Test_Tile_Xml_Adaptive_Root_TextStacking_Top()
});
}
-
[TestMethod]
public void Test_Tile_Xml_Adaptive_Root_TextStacking_Center()
{
AssertBindingMedium(
-
"",
-
new TileBinding()
{
Content = new TileBindingContentAdaptive()
@@ -1080,14 +900,11 @@ public void Test_Tile_Xml_Adaptive_Root_TextStacking_Center()
});
}
-
[TestMethod]
public void Test_Tile_Xml_Adaptive_Root_TextStacking_Bottom()
{
AssertBindingMedium(
-
"",
-
new TileBinding()
{
Content = new TileBindingContentAdaptive()
@@ -1097,19 +914,11 @@ public void Test_Tile_Xml_Adaptive_Root_TextStacking_Bottom()
});
}
-#endregion
-
-
-
-#region BackgroundImage
-
[TestMethod]
public void Test_Tile_Xml_Adaptive_BackgroundImage_Defaults()
{
AssertBindingMediumAdaptive(
-
"",
-
new TileBindingContentAdaptive()
{
BackgroundImage = new TileBackgroundImage()
@@ -1123,9 +932,7 @@ public void Test_Tile_Xml_Adaptive_BackgroundImage_Defaults()
public void Test_Tile_Xml_Adaptive_BackgroundImage_Source()
{
AssertBindingMediumAdaptive(
-
"",
-
new TileBindingContentAdaptive()
{
BackgroundImage = new TileBackgroundImage()
@@ -1141,9 +948,7 @@ public void Test_Tile_Xml_Adaptive_BackgroundImage_Source()
public void Test_Tile_Xml_Adaptive_BackgroundImage_Crop_None()
{
AssertBindingMediumAdaptive(
-
"",
-
new TileBindingContentAdaptive()
{
BackgroundImage = new TileBackgroundImage()
@@ -1158,9 +963,7 @@ public void Test_Tile_Xml_Adaptive_BackgroundImage_Crop_None()
public void Test_Tile_Xml_Adaptive_BackgroundImage_Crop_Circle()
{
AssertBindingMediumAdaptive(
-
"",
-
new TileBindingContentAdaptive()
{
BackgroundImage = new TileBackgroundImage()
@@ -1175,9 +978,7 @@ public void Test_Tile_Xml_Adaptive_BackgroundImage_Crop_Circle()
public void Test_Tile_Xml_Adaptive_BackgroundImage_Overlay_0()
{
AssertBindingMediumAdaptive(
-
"",
-
new TileBindingContentAdaptive()
{
BackgroundImage = new TileBackgroundImage()
@@ -1192,9 +993,7 @@ public void Test_Tile_Xml_Adaptive_BackgroundImage_Overlay_0()
public void Test_Tile_Xml_Adaptive_BackgroundImage_Overlay_20()
{
AssertBindingMediumAdaptive(
-
"",
-
new TileBindingContentAdaptive()
{
BackgroundImage = new TileBackgroundImage()
@@ -1209,9 +1008,7 @@ public void Test_Tile_Xml_Adaptive_BackgroundImage_Overlay_20()
public void Test_Tile_Xml_Adaptive_BackgroundImage_Overlay_80()
{
AssertBindingMediumAdaptive(
-
"",
-
new TileBindingContentAdaptive()
{
BackgroundImage = new TileBackgroundImage()
@@ -1254,17 +1051,11 @@ public void Test_Tile_Xml_Adaptive_BackgroundImage_NoImageSource()
Assert.Fail("Exception should have been thrown");
}
-#endregion
-
-#region PeekImage
-
[TestMethod]
public void Test_Tile_Xml_Adaptive_PeekImage_Defaults()
{
AssertBindingMediumAdaptive(
-
"",
-
new TileBindingContentAdaptive()
{
PeekImage = new TilePeekImage()
@@ -1278,9 +1069,7 @@ public void Test_Tile_Xml_Adaptive_PeekImage_Defaults()
public void Test_Tile_Xml_Adaptive_PeekImage_Source()
{
AssertBindingMediumAdaptive(
-
"",
-
new TileBindingContentAdaptive()
{
PeekImage = new TilePeekImage()
@@ -1296,9 +1085,7 @@ public void Test_Tile_Xml_Adaptive_PeekImage_Source()
public void Test_Tile_Xml_Adaptive_PeekImage_Crop_None()
{
AssertBindingMediumAdaptive(
-
"",
-
new TileBindingContentAdaptive()
{
PeekImage = new TilePeekImage()
@@ -1313,9 +1100,7 @@ public void Test_Tile_Xml_Adaptive_PeekImage_Crop_None()
public void Test_Tile_Xml_Adaptive_PeekImage_Crop_Circle()
{
AssertBindingMediumAdaptive(
-
"",
-
new TileBindingContentAdaptive()
{
PeekImage = new TilePeekImage()
@@ -1330,9 +1115,7 @@ public void Test_Tile_Xml_Adaptive_PeekImage_Crop_Circle()
public void Test_Tile_Xml_Adaptive_PeekImage_Overlay_0()
{
AssertBindingMediumAdaptive(
-
"",
-
new TileBindingContentAdaptive()
{
PeekImage = new TilePeekImage()
@@ -1347,9 +1130,7 @@ public void Test_Tile_Xml_Adaptive_PeekImage_Overlay_0()
public void Test_Tile_Xml_Adaptive_PeekImage_Overlay_20()
{
AssertBindingMediumAdaptive(
-
"",
-
new TileBindingContentAdaptive()
{
PeekImage = new TilePeekImage()
@@ -1364,9 +1145,7 @@ public void Test_Tile_Xml_Adaptive_PeekImage_Overlay_20()
public void Test_Tile_Xml_Adaptive_PeekImage_Overlay_80()
{
AssertBindingMediumAdaptive(
-
"",
-
new TileBindingContentAdaptive()
{
PeekImage = new TilePeekImage()
@@ -1409,17 +1188,11 @@ public void Test_Tile_Xml_Adaptive_PeekImage_NoImageSource()
Assert.Fail("Exception should have been thrown");
}
-#endregion
-
-
-
[TestMethod]
public void Test_Tile_Xml_Adaptive_BackgroundAndPeekImage_Defaults()
{
AssertBindingMediumAdaptive(
-
"",
-
new TileBindingContentAdaptive()
{
BackgroundImage = new TileBackgroundImage()
@@ -1438,9 +1211,7 @@ public void Test_Tile_Xml_Adaptive_BackgroundAndPeekImage_Defaults()
public void Test_Tile_Xml_Adaptive_BackgroundAndPeekImage_Overlay_0and0()
{
AssertBindingMediumAdaptive(
-
"",
-
new TileBindingContentAdaptive()
{
BackgroundImage = new TileBackgroundImage()
@@ -1461,9 +1232,7 @@ public void Test_Tile_Xml_Adaptive_BackgroundAndPeekImage_Overlay_0and0()
public void Test_Tile_Xml_Adaptive_BackgroundAndPeekImage_Overlay_20and20()
{
AssertBindingMediumAdaptive(
-
"",
-
new TileBindingContentAdaptive()
{
BackgroundImage = new TileBackgroundImage()
@@ -1484,9 +1253,7 @@ public void Test_Tile_Xml_Adaptive_BackgroundAndPeekImage_Overlay_20and20()
public void Test_Tile_Xml_Adaptive_BackgroundAndPeekImage_Overlay_20and30()
{
AssertBindingMediumAdaptive(
-
"",
-
new TileBindingContentAdaptive()
{
BackgroundImage = new TileBackgroundImage()
@@ -1507,9 +1274,7 @@ public void Test_Tile_Xml_Adaptive_BackgroundAndPeekImage_Overlay_20and30()
public void Test_Tile_Xml_Adaptive_BackgroundAndPeekImage_Overlay_30and20()
{
AssertBindingMediumAdaptive(
-
"",
-
new TileBindingContentAdaptive()
{
BackgroundImage = new TileBackgroundImage()
@@ -1526,14 +1291,11 @@ public void Test_Tile_Xml_Adaptive_BackgroundAndPeekImage_Overlay_30and20()
});
}
-
[TestMethod]
public void Test_Tile_Xml_Adaptive_BackgroundAndPeekImage_Overlay_0and20()
{
AssertBindingMediumAdaptive(
-
"",
-
new TileBindingContentAdaptive()
{
BackgroundImage = new TileBackgroundImage()
@@ -1549,15 +1311,6 @@ public void Test_Tile_Xml_Adaptive_BackgroundAndPeekImage_Overlay_0and20()
}
});
}
-
-
-#endregion
-
-
-
-#region Special
-
-#region Photos
[TestMethod]
public void Test_Tile_Xml_Special_Photos_Default()
@@ -1640,23 +1393,24 @@ public void Test_Tile_Xml_Special_Photos_MaxImages()
}
};
- AssertBindingMedium(@"
-
-
-
-
-
-
-
-
-
-
-
-
- ", new TileBinding()
- {
- Content = content
- });
+ AssertBindingMedium(
+ @"
+
+
+
+
+
+
+
+
+
+
+
+
+ ", new TileBinding()
+ {
+ Content = content
+ });
}
[TestMethod]
@@ -1684,15 +1438,14 @@ public void Test_Tile_Xml_Special_Photos_TooManyImages()
}
};
}
- catch { return; }
+ catch
+ {
+ return;
+ }
Assert.Fail("Exception should have been thrown, adding more than 12 images isn't supported.");
}
-#endregion
-
-#region People
-
[TestMethod]
public void Test_Tile_Xml_Special_People_Defaults()
{
@@ -1768,10 +1521,6 @@ public void Test_Tile_Xml_Special_People_ManyImages()
});
}
-#endregion
-
-#region Contact
-
[TestMethod]
public void Test_Tile_Xml_Special_Contact_Defaults()
{
@@ -1860,10 +1609,6 @@ public void Test_Tile_Xml_Special_Contact_Both_Medium()
});
}
-#endregion
-
-#region Iconic
-
[TestMethod]
public void Test_Tile_Xml_Special_Iconic_Small()
{
@@ -1887,7 +1632,9 @@ public void Test_Tile_Xml_Special_Iconic_Image()
{
AssertVisual("", new TileVisual()
{
- TileMedium = new TileBinding() { Content = new TileBindingContentIconic()
+ TileMedium = new TileBinding()
+ {
+ Content = new TileBindingContentIconic()
{
Icon = new TileBasicImage()
{
@@ -1899,18 +1646,6 @@ public void Test_Tile_Xml_Special_Iconic_Image()
});
}
-#endregion
-
-#endregion
-
-
-
-
-
-
-
-
-
private static void AssertBindingMediumAdaptive(string expectedBindingXml, TileBindingContentAdaptive content)
{
AssertBindingMedium(expectedBindingXml, new TileBinding() { Content = content });
@@ -1937,6 +1672,4 @@ private static void AssertPayload(string expectedXml, TileContent tile)
AssertHelper.AssertTile(expectedXml, tile);
}
}
-
-
}
\ No newline at end of file
diff --git a/UnitTests/UnitTests.Notifications.Shared/Test_Toast_Xml.cs b/UnitTests/UnitTests.Notifications.Shared/Test_Toast_Xml.cs
index 3702b2b53fe..1fd3d5ef54c 100644
--- a/UnitTests/UnitTests.Notifications.Shared/Test_Toast_Xml.cs
+++ b/UnitTests/UnitTests.Notifications.Shared/Test_Toast_Xml.cs
@@ -3,8 +3,8 @@
// See the LICENSE file in the project root for more information.
using System;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.Toolkit.Uwp.Notifications;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace UnitTests.Notifications
{
@@ -442,12 +442,12 @@ public void Test_ToastV2_ShoulderTapImage()
[TestMethod]
public void Test_ToastV2_ShoulderTapImage_SourceRequired()
{
- Assert.ThrowsException(delegate
+ Assert.ThrowsException(() =>
{
AssertShoulderTapImagePayload("exception should be thrown", new ToastShoulderTapImage());
});
- Assert.ThrowsException(delegate
+ Assert.ThrowsException(() =>
{
new ToastShoulderTapImage()
{
@@ -494,12 +494,12 @@ public void Test_ToastV2_SpriteSheet()
[TestMethod]
public void Test_ToastV2_SpriteSheet_SourceRequired()
{
- Assert.ThrowsException(delegate
+ Assert.ThrowsException(() =>
{
AssertSpriteSheetProperties("exception should be thrown", new ToastSpriteSheet());
});
- Assert.ThrowsException(delegate
+ Assert.ThrowsException(() =>
{
new ToastSpriteSheet()
{
@@ -606,7 +606,6 @@ public void Test_ToastV2_Xml_HeroImage_Default()
{
AssertHeroImagePayload("", hero);
}
-
catch (NullReferenceException)
{
return;
@@ -674,8 +673,6 @@ private static ToastContent GenerateFromVisual(ToastVisual visual)
///
/// Used for testing properties of visual without needing to specify the Generic binding
///
- ///
- ///
private static void AssertVisualPayloadProperties(string expectedVisualProperties, ToastVisual visual)
{
visual.BindingGeneric = new ToastBindingGeneric();
@@ -863,7 +860,10 @@ public void Test_Toast_Xml_Actions_SixTextBoxes()
}
};
}
- catch { return; }
+ catch
+ {
+ return;
+ }
Assert.Fail("Exception should have been thrown.");
}
@@ -939,7 +939,10 @@ public void Test_Toast_Xml_Actions_SixButtons()
}
};
}
- catch { return; }
+ catch
+ {
+ return;
+ }
Assert.Fail("Exception should have been thrown.");
}
@@ -966,7 +969,6 @@ public void Test_Toast_Xml_Actions_SixTotal()
}
});
}
-
catch (InvalidOperationException)
{
return;
@@ -978,7 +980,6 @@ public void Test_Toast_Xml_Actions_SixTotal()
[TestMethod]
public void Test_Toast_Xml_Actions_TwoContextMenuItems()
{
-
AssertActionsPayload("", new ToastActionsCustom()
{
ContextMenuItems =
@@ -992,7 +993,6 @@ public void Test_Toast_Xml_Actions_TwoContextMenuItems()
[TestMethod]
public void Test_Toast_Xml_Actions_FiveContextMenuItems()
{
-
AssertActionsPayload("", new ToastActionsCustom()
{
ContextMenuItems =
@@ -1024,14 +1024,14 @@ public void Test_Toast_Xml_Actions_SixContextMenuItems()
}
});
}
-
- catch { return; }
+ catch
+ {
+ return;
+ }
Assert.Fail("Exception should have been thrown.");
}
-
-
[TestMethod]
public void Test_Toast_Xml_ActionsSnoozeDismiss_TwoContextMenuItems()
{
@@ -1079,8 +1079,10 @@ public void Test_Toast_Xml_Actions_ActionsSnoozeDismiss_SixContextMenuItems()
}
});
}
-
- catch { return; }
+ catch
+ {
+ return;
+ }
Assert.Fail("Exception should have been thrown.");
}
@@ -1100,7 +1102,10 @@ public void Test_Toast_Xml_Button_NullContent()
{
new ToastButton(null, "args");
}
- catch { return; }
+ catch
+ {
+ return;
+ }
Assert.Fail("Exception should have been thrown.");
}
@@ -1112,7 +1117,10 @@ public void Test_Toast_Xml_Button_NullArguments()
{
new ToastButton("content", null);
}
- catch { return; }
+ catch
+ {
+ return;
+ }
Assert.Fail("Exception should have been thrown.");
}
@@ -1285,8 +1293,10 @@ public void Test_Toast_Xml_ContextMenuItem_NullContent()
{
new ToastContextMenuItem(null, "args");
}
-
- catch { return; }
+ catch
+ {
+ return;
+ }
Assert.Fail("Exception should have been thrown.");
}
@@ -1298,8 +1308,10 @@ public void Test_Toast_Xml_ContextMenuItem_NullArguments()
{
new ToastContextMenuItem("content", null);
}
-
- catch { return; }
+ catch
+ {
+ return;
+ }
Assert.Fail("Exception should have been thrown.");
}
@@ -1396,7 +1408,10 @@ public void Test_Toast_Xml_TextBox_NullId()
{
new ToastTextBox(null);
}
- catch { return; }
+ catch
+ {
+ return;
+ }
Assert.Fail("Exception should have been thrown.");
}
@@ -1404,7 +1419,7 @@ public void Test_Toast_Xml_TextBox_NullId()
[TestMethod]
public void Test_Toast_Xml_TextBox_EmptyId()
{
- var textBox = new ToastTextBox("");
+ var textBox = new ToastTextBox(string.Empty);
AssertInputPayload("", textBox);
}
@@ -1420,7 +1435,7 @@ public void Test_Toast_Xml_SelectionBox_Defaults()
[TestMethod]
public void Test_Toast_Xml_SelectionBox_EmptyId()
{
- var selectionBox = new ToastSelectionBox("");
+ var selectionBox = new ToastSelectionBox(string.Empty);
AssertInputPayload("", selectionBox);
}
@@ -1432,7 +1447,10 @@ public void Test_Toast_Xml_SelectionBox_NullId()
{
new ToastSelectionBox(null);
}
- catch { return; }
+ catch
+ {
+ return;
+ }
Assert.Fail("Exception should have been thrown.");
}
@@ -1474,7 +1492,10 @@ public void Test_Toast_Xml_SelectionBoxItem_NullId()
{
new ToastSelectionBoxItem(null, "My content");
}
- catch { return; }
+ catch
+ {
+ return;
+ }
Assert.Fail("Exception should have been thrown.");
}
@@ -1486,7 +1507,10 @@ public void Test_Toast_Xml_SelectionBoxItem_NullContent()
{
new ToastSelectionBoxItem("myId", null);
}
- catch { return; }
+ catch
+ {
+ return;
+ }
Assert.Fail("Exception should have been thrown.");
}
@@ -1494,7 +1518,7 @@ public void Test_Toast_Xml_SelectionBoxItem_NullContent()
[TestMethod]
public void Test_Toast_Xml_SelectionBoxItem_EmptyId()
{
- var selectionBoxItem = new ToastSelectionBoxItem("", "My content");
+ var selectionBoxItem = new ToastSelectionBoxItem(string.Empty, "My content");
AssertSelectionPayload("", selectionBoxItem);
}
@@ -1502,7 +1526,7 @@ public void Test_Toast_Xml_SelectionBoxItem_EmptyId()
[TestMethod]
public void Test_Toast_Xml_SelectionBoxItem_EmptyContent()
{
- var selectionBoxItem = new ToastSelectionBoxItem("myId", "");
+ var selectionBoxItem = new ToastSelectionBoxItem("myId", string.Empty);
AssertSelectionPayload("", selectionBoxItem);
}
@@ -1594,7 +1618,7 @@ public void Test_Toast_Header_NullArguments()
[TestMethod]
public void Test_Toast_Header_EmptyStrings()
{
- AssertHeaderPayload("", new ToastHeader("", "", ""));
+ AssertHeaderPayload("", new ToastHeader(string.Empty, string.Empty, string.Empty));
}
[TestMethod]
@@ -1607,7 +1631,9 @@ public void Test_Toast_Header_ActivationTypes()
AssertHeaderActivationType("background", ToastActivationType.Background);
throw new Exception("ArgumentException should have been thrown, since activation type of background isn't allowed.");
}
- catch (ArgumentException) { }
+ catch (ArgumentException)
+ {
+ }
AssertHeaderActivationType("protocol", ToastActivationType.Protocol);
}
@@ -1679,7 +1705,6 @@ public void Test_Toast_Button_ActivationOptions()
}
catch (InvalidOperationException)
{
-
}
}
@@ -1722,7 +1747,6 @@ public void Test_Toast_ContextMenuItem_ActivationOptions()
}
catch (InvalidOperationException)
{
-
}
}
@@ -1773,7 +1797,6 @@ public void Test_Toast_ActivationOptions()
}
catch (InvalidOperationException)
{
-
}
// Specifying protocol PFN without using protocol activation should throw exception
@@ -1790,7 +1813,6 @@ public void Test_Toast_ActivationOptions()
}
catch (InvalidOperationException)
{
-
}
}
@@ -1825,7 +1847,6 @@ public void Test_Toast_Header_ActivationOptions()
}
catch (InvalidOperationException)
{
-
}
// Specifying protocol PFN without using protocol activation should throw exception
@@ -1841,7 +1862,6 @@ public void Test_Toast_Header_ActivationOptions()
}
catch (InvalidOperationException)
{
-
}
}
@@ -1891,7 +1911,9 @@ public void Test_Toast_ProgressBar_Value()
};
Assert.Fail("Exception should have been thrown, only values 0-1 allowed");
}
- catch (ArgumentOutOfRangeException) { }
+ catch (ArgumentOutOfRangeException)
+ {
+ }
try
{
@@ -1902,7 +1924,9 @@ public void Test_Toast_ProgressBar_Value()
};
Assert.Fail("Exception should have been thrown, only values 0-1 allowed");
}
- catch (ArgumentOutOfRangeException) { }
+ catch (ArgumentOutOfRangeException)
+ {
+ }
}
[TestMethod]
@@ -1925,7 +1949,9 @@ public void Test_Toast_ProgressBar()
AssertProgressBar("Exception should be thrown", new AdaptiveProgressBar());
Assert.Fail("Exception should have been thrown, Status property is required");
}
- catch (NullReferenceException) { }
+ catch (NullReferenceException)
+ {
+ }
AssertProgressBar("", new AdaptiveProgressBar()
{
@@ -2018,21 +2044,22 @@ public void Test_Toast_FullPayload_ShoulderTap()
}
};
- AssertPayload(@"
-
-
- Toast fallback
- Add your fallback toast content here
-
-
-
-
-
-", content);
+ AssertPayload(
+ @"
+
+
+ Toast fallback
+ Add your fallback toast content here
+
+
+
+
+
+ ", content);
}
private static void AssertSelectionPayload(string expectedSelectionXml, ToastSelectionBoxItem selectionItem)
@@ -2046,7 +2073,7 @@ private static void AssertSelectionPayload(string expectedSelectionXml, ToastSel
private static void AssertInputPayload(string expectedInputXml, IToastInput textBox)
{
AssertActionsPayload("" + expectedInputXml + "", new ToastActionsCustom()
- {
+ {
Inputs = { textBox }
});
}
@@ -2058,7 +2085,7 @@ private static void AssertButtonPayload(string expectedButtonXml, IToastButton b
Buttons = { button }
});
}
-
+
private static void AssertContextMenuItemPayload(string expectedContextMenuItemXml, ToastContextMenuItem item)
{
AssertActionsPayload("" + expectedContextMenuItemXml + "", new ToastActionsCustom()
diff --git a/UnitTests/UnitTests.Notifications.Shared/TextXboxModern.cs b/UnitTests/UnitTests.Notifications.Shared/TextXboxModern.cs
index 0f74a66d121..2b3620788c8 100644
--- a/UnitTests/UnitTests.Notifications.Shared/TextXboxModern.cs
+++ b/UnitTests/UnitTests.Notifications.Shared/TextXboxModern.cs
@@ -2,8 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.Toolkit.Uwp.Notifications;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace UnitTests.Notifications
{
@@ -39,7 +39,6 @@ public void TestXboxModernTile()
}
};
-
TileBinding wide = new TileBinding()
{
Content = new TileBindingContentAdaptive()
@@ -87,9 +86,6 @@ public void TestXboxModernTile()
}
};
-
-
-
TileBinding large = new TileBinding()
{
Content = new TileBindingContentAdaptive()
@@ -135,8 +131,6 @@ public void TestXboxModernTile()
}
};
-
-
TileContent content = new TileContent()
{
Visual = new TileVisual()
@@ -149,25 +143,19 @@ public void TestXboxModernTile()
}
};
-
-
string expectedXml = $@"";
// Medium
expectedXml += @"Hi,MasterHip";
-
// Wide
expectedXml += @"Hi,MasterHip";
-
// Large
expectedXml += @"Hi,MasterHip";
-
expectedXml += "";
-
AssertHelper.AssertTile(expectedXml, content);
}
}
diff --git a/UnitTests/UnitTests.Notifications.Shared/UnitTests.Notifications.Shared.projitems b/UnitTests/UnitTests.Notifications.Shared/UnitTests.Notifications.Shared.projitems
index 3e86e6baa94..cb3dc791458 100644
--- a/UnitTests/UnitTests.Notifications.Shared/UnitTests.Notifications.Shared.projitems
+++ b/UnitTests/UnitTests.Notifications.Shared/UnitTests.Notifications.Shared.projitems
@@ -9,7 +9,7 @@
UnitTests.Notifications.Shared
-
+
diff --git a/UnitTests/UnitTests.Notifications.UWP/Properties/AssemblyInfo.cs b/UnitTests/UnitTests.Notifications.UWP/Properties/AssemblyInfo.cs
index 9c93716729d..c5c4f673cff 100644
--- a/UnitTests/UnitTests.Notifications.UWP/Properties/AssemblyInfo.cs
+++ b/UnitTests/UnitTests.Notifications.UWP/Properties/AssemblyInfo.cs
@@ -3,10 +3,9 @@
// See the LICENSE file in the project root for more information.
using System.Reflection;
-using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
-// General Information about an assembly is controlled through the following
+// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("UnitTests.Notifications.UWP")]
@@ -14,10 +13,9 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("UnitTests.Notifications.UWP")]
-[assembly: AssemblyCopyright("Copyright © 2016")]
+[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
-[assembly: AssemblyMetadata("TargetPlatform","UAP")]
-
+[assembly: AssemblyMetadata("TargetPlatform", "UAP")]
[assembly: ComVisible(false)]
\ No newline at end of file
diff --git a/UnitTests/UnitTests.Notifications.UWP/UnitTestApp.xaml.cs b/UnitTests/UnitTests.Notifications.UWP/UnitTestApp.xaml.cs
index bed4e6ee985..b245b1ec075 100644
--- a/UnitTests/UnitTests.Notifications.UWP/UnitTestApp.xaml.cs
+++ b/UnitTests/UnitTests.Notifications.UWP/UnitTestApp.xaml.cs
@@ -16,10 +16,6 @@ namespace UnitTests.Notifications.UWP
///
public sealed partial class App : Application
{
- ///
- /// Initializes the singleton application object. This is the first line of authored code
- /// executed, and as such is the logical equivalent of main() or WinMain().
- ///
public App()
{
InitializeComponent();
@@ -33,7 +29,6 @@ public App()
/// Details about the launch request and process.
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
-
#if DEBUG
if (System.Diagnostics.Debugger.IsAttached)
{
@@ -54,13 +49,13 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
- //TODO: Load state from previously suspended application
+ // TODO: Load state from previously suspended application
}
// Place the frame in the current Window
Window.Current.Content = rootFrame;
}
-
+
Microsoft.VisualStudio.TestPlatform.TestExecutor.UnitTestClient.CreateDefaultUI();
// Ensure the current window is active
@@ -74,7 +69,7 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)
///
/// The Frame which failed navigation
/// Details about the navigation failure
- void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
+ private void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
{
throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
}
@@ -89,7 +84,8 @@ void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
private void OnSuspending(object sender, SuspendingEventArgs e)
{
var deferral = e.SuspendingOperation.GetDeferral();
- //TODO: Save application state and stop any background activity
+
+ // TODO: Save application state and stop any background activity
deferral.Complete();
}
}
diff --git a/UnitTests/UnitTests.Notifications.UWP/UnitTests.Notifications.UWP.csproj b/UnitTests/UnitTests.Notifications.UWP/UnitTests.Notifications.UWP.csproj
index eb0c7ff0380..22884f98e50 100644
--- a/UnitTests/UnitTests.Notifications.UWP/UnitTests.Notifications.UWP.csproj
+++ b/UnitTests/UnitTests.Notifications.UWP/UnitTests.Notifications.UWP.csproj
@@ -29,7 +29,6 @@
false
prompt
true
- UnitTests.Notifications.UWP.ruleset
bin\x86\Release\
@@ -42,7 +41,7 @@
prompt
true
true
- UnitTests.Notifications.UWP.ruleset
+ $(OutputPath)$(AssemblyName).xml
true
@@ -54,7 +53,6 @@
false
prompt
true
- UnitTests.Notifications.UWP.ruleset
bin\ARM\Release\
@@ -67,7 +65,7 @@
prompt
true
true
- UnitTests.Notifications.UWP.ruleset
+ $(OutputPath)$(AssemblyName).xml
true
@@ -79,7 +77,6 @@
false
prompt
true
- UnitTests.Notifications.UWP.ruleset
bin\x64\Release\
@@ -92,7 +89,7 @@
prompt
true
true
- UnitTests.Notifications.UWP.ruleset
+ $(OutputPath)$(AssemblyName).xml
PackageReference
@@ -106,7 +103,6 @@
ARM64
false
prompt
- UnitTests.Notifications.UWP.ruleset
true
@@ -118,8 +114,8 @@
ARM64
false
prompt
- UnitTests.Notifications.UWP.ruleset
true
+ $(OutputPath)$(AssemblyName).xml
@@ -137,6 +133,9 @@
4.5.0
+
+ 4.3.0
+
@@ -154,7 +153,6 @@
Designer
-
diff --git a/UnitTests/UnitTests.Notifications.UWP/UnitTests.Notifications.UWP.ruleset b/UnitTests/UnitTests.Notifications.UWP/UnitTests.Notifications.UWP.ruleset
deleted file mode 100644
index 4c5691a5366..00000000000
--- a/UnitTests/UnitTests.Notifications.UWP/UnitTests.Notifications.UWP.ruleset
+++ /dev/null
@@ -1,236 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/UnitTests/UnitTests.Notifications.WinRT/Properties/AssemblyInfo.cs b/UnitTests/UnitTests.Notifications.WinRT/Properties/AssemblyInfo.cs
index 227d7ed94cd..970ea812300 100644
--- a/UnitTests/UnitTests.Notifications.WinRT/Properties/AssemblyInfo.cs
+++ b/UnitTests/UnitTests.Notifications.WinRT/Properties/AssemblyInfo.cs
@@ -3,10 +3,9 @@
// See the LICENSE file in the project root for more information.
using System.Reflection;
-using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
-// General Information about an assembly is controlled through the following
+// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("UnitTests.Notifications.WinRT")]
@@ -17,6 +16,6 @@
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
-[assembly: AssemblyMetadata("TargetPlatform","UAP")]
+[assembly: AssemblyMetadata("TargetPlatform", "UAP")]
[assembly: ComVisible(false)]
\ No newline at end of file
diff --git a/UnitTests/UnitTests.Notifications.WinRT/UnitTestApp.xaml.cs b/UnitTests/UnitTests.Notifications.WinRT/UnitTestApp.xaml.cs
index 91a90b09402..edbb0bff64a 100644
--- a/UnitTests/UnitTests.Notifications.WinRT/UnitTestApp.xaml.cs
+++ b/UnitTests/UnitTests.Notifications.WinRT/UnitTestApp.xaml.cs
@@ -3,20 +3,10 @@
// See the LICENSE file in the project root for more information.
using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Runtime.InteropServices.WindowsRuntime;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
-using Windows.Foundation;
-using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
-using Windows.UI.Xaml.Controls.Primitives;
-using Windows.UI.Xaml.Data;
-using Windows.UI.Xaml.Input;
-using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace UnitTests.Notifications.WinRT
@@ -24,12 +14,8 @@ namespace UnitTests.Notifications.WinRT
///
/// Provides application-specific behavior to supplement the default Application class.
///
- sealed partial class App : Application
+ internal sealed partial class App : Application
{
- ///
- /// Initializes the singleton application object. This is the first line of authored code
- /// executed, and as such is the logical equivalent of main() or WinMain().
- ///
public App()
{
this.InitializeComponent();
@@ -43,7 +29,6 @@ public App()
/// Details about the launch request and process.
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
-
#if DEBUG
if (System.Diagnostics.Debugger.IsAttached)
{
@@ -64,13 +49,13 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
- //TODO: Load state from previously suspended application
+ // TODO: Load state from previously suspended application
}
// Place the frame in the current Window
Window.Current.Content = rootFrame;
}
-
+
Microsoft.VisualStudio.TestPlatform.TestExecutor.UnitTestClient.CreateDefaultUI();
// Ensure the current window is active
@@ -84,7 +69,7 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)
///
/// The Frame which failed navigation
/// Details about the navigation failure
- void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
+ private void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
{
throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
}
@@ -99,7 +84,8 @@ void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
private void OnSuspending(object sender, SuspendingEventArgs e)
{
var deferral = e.SuspendingOperation.GetDeferral();
- //TODO: Save application state and stop any background activity
+
+ // TODO: Save application state and stop any background activity
deferral.Complete();
}
}
diff --git a/UnitTests/UnitTests.Notifications.WinRT/UnitTests.Notifications.WinRT.csproj b/UnitTests/UnitTests.Notifications.WinRT/UnitTests.Notifications.WinRT.csproj
index 6a397cd7825..76e0af7e3ab 100644
--- a/UnitTests/UnitTests.Notifications.WinRT/UnitTests.Notifications.WinRT.csproj
+++ b/UnitTests/UnitTests.Notifications.WinRT/UnitTests.Notifications.WinRT.csproj
@@ -29,7 +29,6 @@
false
prompt
true
- UnitTests.Notifications.WinRT.ruleset
bin\x86\Release\
@@ -42,7 +41,7 @@
prompt
true
true
- UnitTests.Notifications.WinRT.ruleset
+ $(OutputPath)$(AssemblyName).xml
true
@@ -54,7 +53,6 @@
false
prompt
true
- UnitTests.Notifications.WinRT.ruleset
bin\ARM\Release\
@@ -67,7 +65,7 @@
prompt
true
true
- UnitTests.Notifications.WinRT.ruleset
+ $(OutputPath)$(AssemblyName).xml
true
@@ -79,7 +77,6 @@
false
prompt
true
- UnitTests.Notifications.WinRT.ruleset
bin\x64\Release\
@@ -92,7 +89,7 @@
prompt
true
true
- UnitTests.Notifications.WinRT.ruleset
+ $(OutputPath)$(AssemblyName).xml
PackageReference
@@ -106,7 +103,6 @@
ARM64
false
prompt
- UnitTests.Notifications.WinRT.ruleset
true
@@ -118,8 +114,8 @@
ARM64
false
prompt
- UnitTests.Notifications.WinRT.ruleset
true
+ $(OutputPath)$(AssemblyName).xml
@@ -137,6 +133,9 @@
4.3.0
+
+ 4.3.0
+
@@ -154,7 +153,6 @@
Designer
-
diff --git a/UnitTests/UnitTests.Notifications.WinRT/UnitTests.Notifications.WinRT.ruleset b/UnitTests/UnitTests.Notifications.WinRT/UnitTests.Notifications.WinRT.ruleset
deleted file mode 100644
index 4c5691a5366..00000000000
--- a/UnitTests/UnitTests.Notifications.WinRT/UnitTests.Notifications.WinRT.ruleset
+++ /dev/null
@@ -1,236 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/UnitTests/UnitTests.csproj b/UnitTests/UnitTests.csproj
index b4208dc4fef..2766897eb21 100644
--- a/UnitTests/UnitTests.csproj
+++ b/UnitTests/UnitTests.csproj
@@ -29,24 +29,20 @@
false
prompt
true
- UnitTests.ruleset
bin\x86\Release\
TRACE;NETFX_CORE;WINDOWS_UWP
true
- ;2008
+ ;2008;CS8002
pdbonly
x86
false
prompt
true
true
- true
true
-
-
- UnitTests.ruleset
+ $(OutputPath)$(AssemblyName).xml
true
@@ -58,24 +54,20 @@
false
prompt
true
- UnitTests.ruleset
bin\ARM\Release\
TRACE;NETFX_CORE;WINDOWS_UWP
true
- ;2008
+ ;2008;CS8002
pdbonly
ARM
false
prompt
true
true
- true
true
-
-
- UnitTests.ruleset
+ $(OutputPath)$(AssemblyName).xml
true
@@ -87,24 +79,20 @@
false
prompt
true
- UnitTests.ruleset
bin\x64\Release\
TRACE;NETFX_CORE;WINDOWS_UWP
true
- ;2008
+ ;2008;CS8002
pdbonly
x64
false
prompt
true
true
- true
true
-
-
- UnitTests.ruleset
+ $(OutputPath)$(AssemblyName).xml
PackageReference
@@ -122,8 +110,8 @@
1.2.0
-
- 1.0.2
+
+ 4.3.0
@@ -141,8 +129,10 @@
+
+
@@ -176,9 +166,6 @@
-
- Test_DeepLinkParser.cs
-
UnitTestApp.xaml
@@ -193,7 +180,7 @@
Designer
-
+
@@ -253,7 +240,6 @@
x86
false
prompt
- UnitTests.ruleset
true
@@ -266,7 +252,6 @@
ARM
false
prompt
- UnitTests.ruleset
true
@@ -279,7 +264,6 @@
x64
false
prompt
- UnitTests.ruleset
true
@@ -292,7 +276,6 @@
x86
false
prompt
- UnitTests.ruleset
true
@@ -305,7 +288,6 @@
ARM
false
prompt
- UnitTests.ruleset
true
@@ -318,7 +300,6 @@
x64
false
prompt
- UnitTests.ruleset
true
@@ -330,10 +311,8 @@
true
pdbonly
x86
- true
false
prompt
- UnitTests.ruleset
true
@@ -345,10 +324,8 @@
true
pdbonly
ARM
- true
false
prompt
- UnitTests.ruleset
true
@@ -360,10 +337,8 @@
true
pdbonly
x64
- true
false
prompt
- UnitTests.ruleset
true
@@ -375,10 +350,8 @@
true
pdbonly
x86
- true
false
prompt
- UnitTests.ruleset
true
@@ -390,10 +363,8 @@
true
pdbonly
ARM
- true
false
prompt
- UnitTests.ruleset
true
@@ -405,10 +376,8 @@
true
pdbonly
x64
- true
false
prompt
- UnitTests.ruleset
true
@@ -421,7 +390,6 @@
ARM64
false
prompt
- UnitTests.ruleset
true
@@ -429,14 +397,13 @@
CODE_ANALYSIS;TRACE;NETFX_CORE;WINDOWS_UWP;CODE_ANALYSIS
true
true
- ;2008
+ ;2008;CS8002
true
pdbonly
ARM64
- true
false
prompt
- UnitTests.ruleset
+ $(OutputPath)$(AssemblyName).xml
true
@@ -449,7 +416,6 @@
ARM64
false
prompt
- UnitTests.ruleset
true
@@ -462,7 +428,6 @@
ARM64
false
prompt
- UnitTests.ruleset
true
@@ -474,10 +439,8 @@
true
pdbonly
ARM64
- true
false
prompt
- UnitTests.ruleset
true
@@ -489,10 +452,8 @@
true
pdbonly
ARM64
- true
false
prompt
- UnitTests.ruleset
true
diff --git a/UnitTests/UnitTests.ruleset b/UnitTests/UnitTests.ruleset
deleted file mode 100644
index b5a3e1a710c..00000000000
--- a/UnitTests/UnitTests.ruleset
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file