diff options
author | Eric Maupin <ermaup@microsoft.com> | 2018-11-12 23:52:29 +0300 |
---|---|---|
committer | Eric Maupin <ermaup@microsoft.com> | 2018-11-12 23:52:29 +0300 |
commit | 2c0753103a77ba80c5ecae80cd29c78ad38635c8 (patch) | |
tree | 76a984ed7af74179858eca0287a66be76a8a51d6 | |
parent | db86b7f37610bbd1cbb79a8561dfb19bd5709b07 (diff) |
[Tests] Add auto-expand group tests
-rw-r--r-- | Xamarin.PropertyEditing.Tests/PanelViewModelTests.cs | 27 | ||||
-rw-r--r-- | Xamarin.PropertyEditing.Windows.Standalone/MainWindow.xaml.cs | 3 |
2 files changed, 29 insertions, 1 deletions
diff --git a/Xamarin.PropertyEditing.Tests/PanelViewModelTests.cs b/Xamarin.PropertyEditing.Tests/PanelViewModelTests.cs index 64266ec..6d39f22 100644 --- a/Xamarin.PropertyEditing.Tests/PanelViewModelTests.cs +++ b/Xamarin.PropertyEditing.Tests/PanelViewModelTests.cs @@ -387,6 +387,33 @@ namespace Xamarin.PropertyEditing.Tests Assert.That (vm.GetIsExpanded ("ints"), Is.True); } + [Test] + public void AutoExpandChosenGroups () + { + var normalProp = new Mock<IPropertyInfo> (); + normalProp.SetupGet (p => p.Type).Returns (typeof (string)); + normalProp.SetupGet (p => p.Category).Returns ("Category"); + normalProp.SetupGet (p => p.Name).Returns ("name"); + + var target = new object (); + + var provider = new Mock<IEditorProvider> (); + provider.Setup (p => p.GetObjectEditorAsync (target)) + .ReturnsAsync (new MockObjectEditor (normalProp.Object)); + + var platform = new TargetPlatform (provider.Object) { + AutoExpandGroups = new[] { normalProp.Object.Category } + }; + + var vm = new PanelViewModel (platform) { + ArrangeMode = PropertyArrangeMode.Category + }; + vm.SelectedObjects.Add (target); + + Assume.That (vm.ArrangedEditors, Is.Not.Empty); + Assert.That (vm.GetIsExpanded (normalProp.Object.Category), Is.True); + } + internal override PanelViewModel CreateVm (TargetPlatform platform) { return new PanelViewModel (platform); diff --git a/Xamarin.PropertyEditing.Windows.Standalone/MainWindow.xaml.cs b/Xamarin.PropertyEditing.Windows.Standalone/MainWindow.xaml.cs index d543269..382c1a5 100644 --- a/Xamarin.PropertyEditing.Windows.Standalone/MainWindow.xaml.cs +++ b/Xamarin.PropertyEditing.Windows.Standalone/MainWindow.xaml.cs @@ -22,7 +22,8 @@ namespace Xamarin.PropertyEditing.Windows.Standalone SupportsBrushOpacity = false, GroupedTypes = new Dictionary<Type, string> { { typeof(CommonBrush), "Brush" } - } + }, + AutoExpandGroups = new[] { "ReadWrite" } }; #if USE_VS_ICONS |