public ConvertFrom ( ITypeDescriptorContext context, |
||
context | ITypeDescriptorContext | |
culture | ||
value | object | |
리턴 | object |
public void GenericWithConverterConvertFromString() { var converter = new StringArrayConverter <MemberTypes, EnumConverter>(",", StringSplitOptions.RemoveEmptyEntries); Assert.That(converter.ConvertFrom("Custom, Field"), Has.Length.EqualTo(2)); Assert.That(converter.ConvertFrom("Custom, Field"), Is.EquivalentTo(new[] { MemberTypes.Custom, MemberTypes.Field })); }
public void GenericConvertFromString() { var converter = new StringArrayConverter<MemberTypes>(",", StringSplitOptions.RemoveEmptyEntries); Assert.That(converter.ConvertFrom("Custom, Field"), Has.Length.EqualTo(2)); Assert.That(converter.ConvertFrom("Custom, Field"), Is.EquivalentTo(new[] { MemberTypes.Custom, MemberTypes.Field })); }
public void ConvertFromString() { var converter = new StringArrayConverter(",", StringSplitOptions.RemoveEmptyEntries); Assert.That(converter.ConvertFrom("one, two"), Has.Length.EqualTo(2)); Assert.That(converter.ConvertFrom("one, two"), Is.EquivalentTo(new[] { "one", "two" })); }
public void ConvertFromString() { var converter = new StringArrayConverter(",", StringSplitOptions.RemoveEmptyEntries); Assert.That(converter.ConvertFrom("one, two"), Has.Length.EqualTo(2)); Assert.That(converter.ConvertFrom("one, two"), Is.EquivalentTo(new[] { "one", "two" })); }