-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'Dreamescaper-object_parameters'
- Loading branch information
Showing
8 changed files
with
174 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
src/Microsoft.MobileBlazorBindings.Core/Properties/AttributeInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
using System.Runtime.CompilerServices; | ||
|
||
[assembly:InternalsVisibleTo("Microsoft.MobileBlazorBindings.UnitTests, PublicKey=0024000004800000140100000602000000240000525341310008000001000100d569ddedcc845677b8d3a876b4fd0aee523a4260bfa2a62590184038fd15e6a78b4931a1501644ad1a087b2d3f949e407e52e98ec8fdfb49228b0e7abafb99aa83a5bb6021181a8a69e17e1b0ab4d9fdb1402b254cb56006c35fc46904ed83d1d795a0ceaf34600f3344718f8f81aa79a305fcd87acf01be47d29ddc4dc22db66bf2aea3102b1d51961acb0f3a8e66fcba8705c23f868cebfc7487f741dd3c249acf0bdbe5ad183cf2c5c20abaed017ca2e1b44f10504b90eee3245152ff2bd0198041645435ddaf4fb2cb5c1bc95c5915d7d338f1f20a38fe91892b5baa6b974630b9eb5ea508e2589d0bd8ea255b9b0869ed1b843521c9fc511d482a81c7df")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/Microsoft.MobileBlazorBindings.UnitTests/ShellNavigation/ShellNavigationManagerTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using Microsoft.MobileBlazorBindings.Core; | ||
using NUnit.Framework; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace Microsoft.MobileBlazorBindings.UnitTests.ShellNavigation | ||
{ | ||
public class ShellNavigationManagerTests | ||
{ | ||
private static Guid testGuid = Guid.NewGuid(); | ||
public static IEnumerable<TestCaseData> TryParseTestData | ||
{ | ||
get | ||
{ | ||
yield return new TestCaseData("s", typeof(string), "s", true).SetName("Parse valid string"); | ||
yield return new TestCaseData("5", typeof(int), 5, true).SetName("Parse valid int"); | ||
yield return new TestCaseData("5", typeof(int?), 5, true).SetName("Parse valid int?"); | ||
yield return new TestCaseData("invalid text", typeof(int), 0, false).SetName("Parse invalid int"); | ||
yield return new TestCaseData("2020-05-20", typeof(DateTime), new DateTime(2020, 05, 20), true).SetName("Parse valid date"); | ||
yield return new TestCaseData("invalid text", typeof(DateTime), new DateTime(), false).SetName("Parse invalid date"); | ||
yield return new TestCaseData(testGuid.ToString(), typeof(Guid), testGuid, true).SetName("Parse valid GUID"); | ||
yield return new TestCaseData(testGuid.ToString(), typeof(Guid?), testGuid, true).SetName("Parse valid GUID?"); | ||
yield return new TestCaseData("invalid text", typeof(Guid), new Guid(), false).SetName("Parse invalid GUID"); | ||
yield return new TestCaseData("{'value': '5'}", typeof(object), null, false).SetName("Parse POCO should find null operation"); | ||
} | ||
} | ||
|
||
[TestCaseSource(nameof(TryParseTestData))] | ||
public void TryParseTest(string s, Type type, object expectedResult, bool expectedSuccess) | ||
{ | ||
var success = ShellNavigationManager.TryParse(type, s, out var result); | ||
Assert.Multiple(() => | ||
{ | ||
Assert.AreEqual(expectedResult, result); | ||
Assert.AreEqual(expectedSuccess, success); | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
src/Microsoft.MobileBlazorBindings/Properties/AttributeInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
using System.Runtime.CompilerServices; | ||
|
||
[assembly:InternalsVisibleTo("Microsoft.MobileBlazorBindings.UnitTests, PublicKey=0024000004800000140100000602000000240000525341310008000001000100d569ddedcc845677b8d3a876b4fd0aee523a4260bfa2a62590184038fd15e6a78b4931a1501644ad1a087b2d3f949e407e52e98ec8fdfb49228b0e7abafb99aa83a5bb6021181a8a69e17e1b0ab4d9fdb1402b254cb56006c35fc46904ed83d1d795a0ceaf34600f3344718f8f81aa79a305fcd87acf01be47d29ddc4dc22db66bf2aea3102b1d51961acb0f3a8e66fcba8705c23f868cebfc7487f741dd3c249acf0bdbe5ad183cf2c5c20abaed017ca2e1b44f10504b90eee3245152ff2bd0198041645435ddaf4fb2cb5c1bc95c5915d7d338f1f20a38fe91892b5baa6b974630b9eb5ea508e2589d0bd8ea255b9b0869ed1b843521c9fc511d482a81c7df")] |
Oops, something went wrong.