diff options
Diffstat (limited to 'Xamarin.PropertyEditing.Tests')
-rw-r--r-- | Xamarin.PropertyEditing.Tests/PanelViewModelTests.cs | 27 |
1 files changed, 27 insertions, 0 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); |