diff options
author | Eric Maupin <ermaup@microsoft.com> | 2018-01-24 20:45:57 +0300 |
---|---|---|
committer | Eric Maupin <ermaup@microsoft.com> | 2018-01-25 21:24:33 +0300 |
commit | 56a27e53d8c5775ff67c22e907c096a3face99b1 (patch) | |
tree | beac093aaaecf03ddf74265933099e516a1d4595 /Xamarin.PropertyEditing.Tests/MockEditorProvider.cs | |
parent | 6402272acc41780bb052eb99171eb693ee8dd744 (diff) |
[Tests] Support object creation/relevancy
Diffstat (limited to 'Xamarin.PropertyEditing.Tests/MockEditorProvider.cs')
-rw-r--r-- | Xamarin.PropertyEditing.Tests/MockEditorProvider.cs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Xamarin.PropertyEditing.Tests/MockEditorProvider.cs b/Xamarin.PropertyEditing.Tests/MockEditorProvider.cs index 7c73312..05b3b8b 100644 --- a/Xamarin.PropertyEditing.Tests/MockEditorProvider.cs +++ b/Xamarin.PropertyEditing.Tests/MockEditorProvider.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.Threading.Tasks; using Xamarin.PropertyEditing.Reflection; @@ -22,7 +23,11 @@ namespace Xamarin.PropertyEditing.Tests public Task<object> CreateObjectAsync (ITypeInfo type) { - throw new System.NotImplementedException (); + Type realType = Type.GetType ($"{type.NameSpace}.{type.Name}, {type.Assembly.Name}"); + if (realType == null) + return Task.FromResult<object> (null); + + return Task.FromResult (Activator.CreateInstance (realType)); } private Dictionary<object, IObjectEditor> editorCache = new Dictionary<object, IObjectEditor> (); |