diff options
Diffstat (limited to 'Xamarin.PropertyEditing.Tests/MockPropertyInfo/MockPropertyInfo.cs')
-rw-r--r-- | Xamarin.PropertyEditing.Tests/MockPropertyInfo/MockPropertyInfo.cs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Xamarin.PropertyEditing.Tests/MockPropertyInfo/MockPropertyInfo.cs b/Xamarin.PropertyEditing.Tests/MockPropertyInfo/MockPropertyInfo.cs index e21737e..e916f0e 100644 --- a/Xamarin.PropertyEditing.Tests/MockPropertyInfo/MockPropertyInfo.cs +++ b/Xamarin.PropertyEditing.Tests/MockPropertyInfo/MockPropertyInfo.cs @@ -9,8 +9,8 @@ namespace Xamarin.PropertyEditing.Tests.MockPropertyInfo public class MockPropertyInfoWithInputTypes<T> : MockPropertyInfo<T>, IHaveInputModes { - public MockPropertyInfoWithInputTypes (string name, IReadOnlyList<InputMode> inputModes, string description = null, string category = null, bool canWrite = true, IEnumerable<Type> converterTypes = null, ValueSources valueSources = ValueSources.Default | ValueSources.Local) - : base (name, description, category, canWrite, converterTypes, valueSources) + public MockPropertyInfoWithInputTypes (string name, IReadOnlyList<InputMode> inputModes, string description = null, string category = null, bool canWrite = true, IEnumerable<Type> converterTypes = null, ValueSources valueSources = ValueSources.Default | ValueSources.Local, PropertyVariation[] variations = null) + : base (name, description, category, canWrite, converterTypes, valueSources, variations) { InputModes = inputModes.ToArray (); } @@ -23,7 +23,7 @@ namespace Xamarin.PropertyEditing.Tests.MockPropertyInfo public class MockPropertyInfo<T> : IPropertyInfo, IPropertyConverter, IEquatable<MockPropertyInfo<T>> { - public MockPropertyInfo (string name, string description = null, string category = null, bool canWrite = true, IEnumerable<Type> converterTypes = null, ValueSources valueSources = ValueSources.Local | ValueSources.Default) + public MockPropertyInfo (string name, string description = null, string category = null, bool canWrite = true, IEnumerable<Type> converterTypes = null, ValueSources valueSources = ValueSources.Local | ValueSources.Default, PropertyVariation[] variations = null) { Name = name; Description = description; @@ -40,6 +40,8 @@ namespace Xamarin.PropertyEditing.Tests.MockPropertyInfo if (typeof(T).IsValueType) { this.nullConverter = new NullableConverter (typeof(Nullable<>).MakeGenericType (typeof(T))); } + + Variations = variations ?? EmptyVariations; } public string Name { get; } @@ -52,7 +54,8 @@ namespace Xamarin.PropertyEditing.Tests.MockPropertyInfo public bool CanWrite { get; } public ValueSources ValueSources { get; } static readonly PropertyVariation[] EmptyVariations = new PropertyVariation[0]; - public virtual IReadOnlyList<PropertyVariation> Variations => EmptyVariations; + + public virtual IReadOnlyList<PropertyVariation> Variations { get; } static readonly IAvailabilityConstraint[] EmptyConstraints = new IAvailabilityConstraint[0]; public virtual IReadOnlyList<IAvailabilityConstraint> AvailabilityConstraints => EmptyConstraints; |