diff options
Diffstat (limited to 'Xamarin.PropertyEditing.Tests')
3 files changed, 6 insertions, 5 deletions
diff --git a/Xamarin.PropertyEditing.Tests/MockControls/MockControl.cs b/Xamarin.PropertyEditing.Tests/MockControls/MockControl.cs index b7685ba..8004461 100644 --- a/Xamarin.PropertyEditing.Tests/MockControls/MockControl.cs +++ b/Xamarin.PropertyEditing.Tests/MockControls/MockControl.cs @@ -14,14 +14,14 @@ namespace Xamarin.PropertyEditing.Tests.MockControls public void AddProperty<T> (string name, string category = null, bool canWrite = true, bool flag = false, IEnumerable<Type> converterTypes = null, - string description = null, ValueSources valueSources = ValueSources.Local | ValueSources.Default | ValueSources.Binding) + string description = null, bool constrained = true, ValueSources valueSources = ValueSources.Local | ValueSources.Default | ValueSources.Binding) { IPropertyInfo propertyInfo; if (typeof(T).IsEnum) { var underlyingType = typeof (T).GetEnumUnderlyingType (); var enumPropertyInfoType = typeof (MockEnumPropertyInfo<,>) .MakeGenericType (underlyingType, typeof (T)); - propertyInfo = (IPropertyInfo)Activator.CreateInstance (enumPropertyInfoType, name, description, category, canWrite, flag, converterTypes); + propertyInfo = (IPropertyInfo)Activator.CreateInstance (enumPropertyInfoType, name, description, category, canWrite, flag, converterTypes, constrained); } else { propertyInfo = new MockPropertyInfo<T> (name, description, category, canWrite, converterTypes, valueSources); } diff --git a/Xamarin.PropertyEditing.Tests/MockControls/MockSampleControl.cs b/Xamarin.PropertyEditing.Tests/MockControls/MockSampleControl.cs index faafc83..3fe6e51 100644 --- a/Xamarin.PropertyEditing.Tests/MockControls/MockSampleControl.cs +++ b/Xamarin.PropertyEditing.Tests/MockControls/MockSampleControl.cs @@ -16,7 +16,7 @@ namespace Xamarin.PropertyEditing.Tests.MockControls AddProperty<int> ("UnsetInteger", ReadWrite, valueSources: ValueSources.Local); AddProperty<float> ("FloatingPoint", ReadWrite); AddProperty<string> ("String", ReadWrite, valueSources: ValueSources.Local | ValueSources.Resource | ValueSources.Binding); - AddProperty<Enumeration> ("Enumeration", ReadWrite); + AddProperty<Enumeration> ("Enumeration", ReadWrite, constrained: false); AddProperty<FlagsNoValues> ("FlagsNoValues", ReadWrite, canWrite: true, flag: true); AddProperty<FlagsWithValues> ("FlagsWithValues", ReadWrite, canWrite: true, flag: true); AddProperty<CommonPoint> ("Point", ReadWrite); diff --git a/Xamarin.PropertyEditing.Tests/MockPropertyInfo/MockEnumPropertyInfo.cs b/Xamarin.PropertyEditing.Tests/MockPropertyInfo/MockEnumPropertyInfo.cs index 42342f9..fd4be86 100644 --- a/Xamarin.PropertyEditing.Tests/MockPropertyInfo/MockEnumPropertyInfo.cs +++ b/Xamarin.PropertyEditing.Tests/MockPropertyInfo/MockEnumPropertyInfo.cs @@ -15,7 +15,7 @@ namespace Xamarin.PropertyEditing.Tests.MockPropertyInfo where TUnderlying : struct where TEnum : struct { - public MockEnumPropertyInfo (string name, string description = null, string category = "", bool canWrite = true, bool flag = false, IEnumerable<Type> converterTypes = null) + public MockEnumPropertyInfo (string name, string description = null, string category = "", bool canWrite = true, bool flag = false, IEnumerable<Type> converterTypes = null, bool constrained = true) : base (name, description, category, canWrite, converterTypes) { var names = Enum.GetNames (typeof (TEnum)); @@ -33,12 +33,13 @@ namespace Xamarin.PropertyEditing.Tests.MockPropertyInfo PredefinedValues = predefinedValues; } + IsConstrainedToPredefined = constrained; IsValueCombinable = flag; } public override Type Type => typeof (TEnum); - public bool IsConstrainedToPredefined => true; + public bool IsConstrainedToPredefined { get; } public bool IsValueCombinable { get; } |