Inheritance: System.ComponentModel.ArrayConverter
示例#1
0
        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 }));
        }
示例#2
0
        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" }));
        }
示例#3
0
        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);
        }
示例#4
0
        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 }));
        }
        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 CanConvertToAssertions()
        {
            var converter = new StringArrayConverter(",", StringSplitOptions.RemoveEmptyEntries);

            Assert.That(converter.CanConvertTo(typeof(string)), Is.True);
            Assert.That(converter.CanConvertTo(typeof(int)), Is.False);
        }