diff options
author | Dominique Louis <savagesoftware@gmail.com> | 2018-09-26 16:33:51 +0300 |
---|---|---|
committer | Dominique Louis <dominique@Dominiques-MacBook-Pro-2.local> | 2018-10-09 18:39:12 +0300 |
commit | 15fab46136698f3c45aebc9f684c385404af881e (patch) | |
tree | 058bb08ad5538de9a73f30207a9f79e0883a643e | |
parent | 50f5343c60e728648c5bdae3f1435d4daae4aaf2 (diff) |
[Tests] Fixes for failing tests.
4 files changed, 5 insertions, 4 deletions
diff --git a/Xamarin.PropertyEditing.Tests/PanelViewModelTests.cs b/Xamarin.PropertyEditing.Tests/PanelViewModelTests.cs index 723d86f..64266ec 100644 --- a/Xamarin.PropertyEditing.Tests/PanelViewModelTests.cs +++ b/Xamarin.PropertyEditing.Tests/PanelViewModelTests.cs @@ -58,7 +58,6 @@ namespace Xamarin.PropertyEditing.Tests await Task.Yield (); Assert.That (vm.Properties, Is.Empty); - this.context.ThrowPendingExceptions (); } [Test] diff --git a/Xamarin.PropertyEditing.Tests/PropertiesViewModelTests.cs b/Xamarin.PropertyEditing.Tests/PropertiesViewModelTests.cs index 6560aa9..0e72058 100644 --- a/Xamarin.PropertyEditing.Tests/PropertiesViewModelTests.cs +++ b/Xamarin.PropertyEditing.Tests/PropertiesViewModelTests.cs @@ -231,6 +231,7 @@ namespace Xamarin.PropertyEditing.Tests var editor = new Mock<IObjectEditor> (); editor.SetupGet (e => e.Target).Returns (obj); editor.SetupGet (e => e.Properties).Returns (new IPropertyInfo[0]); + editor.SetupGet (oe => oe.TargetType).Returns (obj.GetType ().ToTypeInfo ()); var provider = new Mock<IEditorProvider> (); provider.Setup (p => p.GetObjectEditorAsync (obj)).ReturnsAsync (editor.Object); @@ -318,6 +319,7 @@ namespace Xamarin.PropertyEditing.Tests var editor2 = new Mock<IObjectEditor> (); editor2.SetupGet (e => e.Properties).Returns (new IPropertyInfo[0]); editor2.SetupGet (e => e.Target).Returns (obj2); + editor2.SetupGet (oe => oe.TargetType).Returns (obj2.GetType ().ToTypeInfo ()); editor2.As<INameableObject> (); var provider = new Mock<IEditorProvider> (); diff --git a/Xamarin.PropertyEditing.Tests/RatioViewModelTests.cs b/Xamarin.PropertyEditing.Tests/RatioViewModelTests.cs index 9aeedd0..5f6493f 100644 --- a/Xamarin.PropertyEditing.Tests/RatioViewModelTests.cs +++ b/Xamarin.PropertyEditing.Tests/RatioViewModelTests.cs @@ -81,8 +81,8 @@ namespace Xamarin.PropertyEditing.Tests var property = GetPropertyMock (); var editor = GetBasicEditor (property.Object); var vm = GetViewModel (property.Object, new[] { editor }); - Assume.That (vm.Numerator, Is.EqualTo (0)); - Assume.That (vm.Denominator, Is.EqualTo (0)); + Assume.That (vm.Numerator, Is.EqualTo (1)); + Assume.That (vm.Denominator, Is.EqualTo (1)); bool nChanged = false, dChanged = false, sChanged = false, valueChanged = false; vm.PropertyChanged += (sender, args) => { diff --git a/Xamarin.PropertyEditing/ViewModels/CollectionPropertyViewModel.cs b/Xamarin.PropertyEditing/ViewModels/CollectionPropertyViewModel.cs index 080a93a..89802d2 100644 --- a/Xamarin.PropertyEditing/ViewModels/CollectionPropertyViewModel.cs +++ b/Xamarin.PropertyEditing/ViewModels/CollectionPropertyViewModel.cs @@ -152,7 +152,7 @@ namespace Xamarin.PropertyEditing.ViewModels if (value == OtherType) RequestOtherType (previousType); - ((RelayCommand)AddTargetCommand).ChangeCanExecute(); + ((RelayCommand)AddTargetCommand)?.ChangeCanExecute(); } } |