public void ConvertTest() { var converter = new EnumerableConverter(); var typeConverterOptions = new TypeConverterOptions { CultureInfo = CultureInfo.CurrentCulture }; Assert.IsTrue( converter.CanConvertFrom( typeof( string ) ) ); Assert.IsTrue( converter.CanConvertTo( typeof( string ) ) ); try { converter.ConvertFromString( typeConverterOptions, "" ); Assert.Fail(); } catch( CsvTypeConverterException ) { } try { converter.ConvertToString( typeConverterOptions, 5 ); Assert.Fail(); } catch( CsvTypeConverterException ) { } }
public void ConvertTest() { var converter = new EnumerableConverter(); var propertyMapData = new CsvPropertyMapData( null ); propertyMapData.TypeConverterOptions.CultureInfo = CultureInfo.CurrentCulture; try { converter.ConvertFromString( "", null, propertyMapData ); Assert.Fail(); } catch( CsvTypeConverterException ) { } try { converter.ConvertToString( 5, null, propertyMapData ); Assert.Fail(); } catch( CsvTypeConverterException ) { } }