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 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 GenericWithConverterCanConvertToAssertions() { var converter = new StringArrayConverter <MemberTypes, EnumConverter>(",", StringSplitOptions.RemoveEmptyEntries); Assert.That(converter.CanConvertTo(typeof(string)), Is.True); Assert.That(converter.CanConvertTo(typeof(int)), Is.False); }
public void CanConvertToAssertions() { var converter = new StringArrayConverter(",", StringSplitOptions.RemoveEmptyEntries); Assert.That(converter.CanConvertTo(typeof(string)), Is.True); Assert.That(converter.CanConvertTo(typeof(int)), Is.False); }
public void GenericWithConverterCanConvertToAssertions() { var converter = new StringArrayConverter<MemberTypes, EnumConverter>(",", StringSplitOptions.RemoveEmptyEntries); Assert.That(converter.CanConvertTo(typeof(string)), Is.True); Assert.That(converter.CanConvertTo(typeof(int)), Is.False); }
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 })); }