diff options
author | Eric Maupin <ermaup@microsoft.com> | 2018-08-31 22:38:18 +0300 |
---|---|---|
committer | Eric Maupin <ermaup@microsoft.com> | 2018-08-31 22:38:22 +0300 |
commit | 537e3372ebdf61b3490d848b5c45fa4b5ed982b0 (patch) | |
tree | b01cc860322212b435a40641c5920d4199644fdc /Xamarin.PropertyEditing.Tests | |
parent | 738949a696525c3166ef8da269f522b525fdcc19 (diff) |
[Core] Handle no-editors in CollectionPropertyViewModel
Fixes #294
Diffstat (limited to 'Xamarin.PropertyEditing.Tests')
-rw-r--r-- | Xamarin.PropertyEditing.Tests/CollectionPropertyViewModelTests.cs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Xamarin.PropertyEditing.Tests/CollectionPropertyViewModelTests.cs b/Xamarin.PropertyEditing.Tests/CollectionPropertyViewModelTests.cs index 0139aad..7f87448 100644 --- a/Xamarin.PropertyEditing.Tests/CollectionPropertyViewModelTests.cs +++ b/Xamarin.PropertyEditing.Tests/CollectionPropertyViewModelTests.cs @@ -158,6 +158,28 @@ namespace Xamarin.PropertyEditing.Tests } [Test] + public async Task RemoveEditor () + { + TargetPlatform platform = new TargetPlatform (new MockEditorProvider ()); + + var obj = new { + Collection = new ArrayList () + }; + + var editor = new ReflectionObjectEditor (obj); + + var vm = new CollectionPropertyViewModel (platform, editor.Properties.First (), new[] { editor }); + await vm.AssignableTypes.Task; + + vm.Editors.Remove (editor); + await vm.AssignableTypes.Task; + + Assert.That (vm.AssignableTypes.Value, Is.Empty); + Assert.That (vm.SuggestedTypes, Is.Empty); + Assert.That (vm.SelectedType, Is.Null); + } + + [Test] public async Task MoveUpCommand () { TargetPlatform platform = new TargetPlatform (new MockEditorProvider()); |