diff options
author | Eric Maupin <ermaup@microsoft.com> | 2017-01-13 23:05:11 +0300 |
---|---|---|
committer | Eric Maupin <ermaup@microsoft.com> | 2017-01-13 23:05:11 +0300 |
commit | 62511ef2d6389aa417965d80a8ada8e30de74e5a (patch) | |
tree | 10f754a26c215a5f612d628595d92ccd2306478e /Xamarin.PropertyEditing.Tests/ReflectionPropertyProviderTests.cs | |
parent | beac248b579ba53958631c20e1588b71be17f26e (diff) |
Reflection editor property changed
Diffstat (limited to 'Xamarin.PropertyEditing.Tests/ReflectionPropertyProviderTests.cs')
-rw-r--r-- | Xamarin.PropertyEditing.Tests/ReflectionPropertyProviderTests.cs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Xamarin.PropertyEditing.Tests/ReflectionPropertyProviderTests.cs b/Xamarin.PropertyEditing.Tests/ReflectionPropertyProviderTests.cs index 63e3f5d..2e547f7 100644 --- a/Xamarin.PropertyEditing.Tests/ReflectionPropertyProviderTests.cs +++ b/Xamarin.PropertyEditing.Tests/ReflectionPropertyProviderTests.cs @@ -85,6 +85,30 @@ namespace Xamarin.PropertyEditing.Tests Assert.That (info.Value, Is.EqualTo (1)); } + [Test] + public async Task PropertyChanged () + { + var obj = new TestClass (); + + var provider = new ReflectionEditorProvider (); + IObjectEditor editor = await provider.GetObjectEditorAsync (obj); + + const string value = "value"; + var property = editor.Properties.Single (); + + bool changed = false; + editor.PropertyChanged += (sender, args) => { + if (Equals (args.Property, property)) + changed = true; + }; + + await editor.SetValueAsync (property, new ValueInfo<string> { + Value = value + }); + + Assert.That (changed, Is.True, "PropertyChanged was not raised for the given property"); + } + private class TestClass { public string Property |