diff options
author | Eric Maupin <ermaup@microsoft.com> | 2018-02-15 03:48:59 +0300 |
---|---|---|
committer | Eric Maupin <ermaup@microsoft.com> | 2018-02-15 03:54:52 +0300 |
commit | a890e355a17f4a0508db26a4bd733437f17bb860 (patch) | |
tree | f8ecb3bf75b0a8636ad34ee4419d86673ac2260f /Xamarin.PropertyEditing.Tests/BoolViewModelTests.cs | |
parent | f3e33678e78a6bc57e840bd1d10a7f9bd55d9ea6 (diff) |
[Core] Support nullable and unset primitives
Diffstat (limited to 'Xamarin.PropertyEditing.Tests/BoolViewModelTests.cs')
-rw-r--r-- | Xamarin.PropertyEditing.Tests/BoolViewModelTests.cs | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/Xamarin.PropertyEditing.Tests/BoolViewModelTests.cs b/Xamarin.PropertyEditing.Tests/BoolViewModelTests.cs index 51416ea..a8615f8 100644 --- a/Xamarin.PropertyEditing.Tests/BoolViewModelTests.cs +++ b/Xamarin.PropertyEditing.Tests/BoolViewModelTests.cs @@ -1,10 +1,12 @@ -using System; +using System; using System.Collections.Generic; +using NUnit.Framework; using Xamarin.PropertyEditing.ViewModels; namespace Xamarin.PropertyEditing.Tests { - class BoolViewModelTests + [TestFixture] + internal class BoolViewModelTests : PropertyViewModelTests<bool, PropertyViewModel<bool>> { protected override bool GetRandomTestValue (Random rand) @@ -17,4 +19,19 @@ namespace Xamarin.PropertyEditing.Tests return new PropertyViewModel<bool> (platform, property, editors); } } + + [TestFixture] + internal class NullableBoolViewModelTests + : PropertyViewModelTests<bool?, bool, PropertyViewModel<bool?>> + { + protected override bool? GetRandomTestValue (Random rand) + { + return (rand.Next (0, 2) == 1); + } + + protected override PropertyViewModel<bool?> GetViewModel (TargetPlatform platform, IPropertyInfo property, IEnumerable<IObjectEditor> editors) + { + return new PropertyViewModel<bool?> (platform, property, editors); + } + } } |