public void ConvertToStringTest() { var converter = new BooleanConverter(); Assert.Equal( "True", converter.ConvertToString( true ) ); Assert.Equal( "False", converter.ConvertToString( false ) ); Assert.Equal( "", converter.ConvertToString( null ) ); Assert.Equal( "1", converter.ConvertToString( 1 ) ); }
public void ConvertToStringTest() { var converter = new BooleanConverter(); Assert.AreEqual( "True", converter.ConvertToString( CultureInfo.CurrentCulture, true ) ); Assert.AreEqual( "False", converter.ConvertToString( CultureInfo.CurrentCulture, false ) ); Assert.AreEqual( "", converter.ConvertToString( CultureInfo.CurrentCulture, null ) ); Assert.AreEqual( "1", converter.ConvertToString( CultureInfo.CurrentCulture, 1 ) ); }
public void ConvertToStringTest() { var converter = new BooleanConverter(); var typeConverterOptions = new TypeConverterOptions { CultureInfo = CultureInfo.CurrentCulture }; Assert.AreEqual( "True", converter.ConvertToString( typeConverterOptions, true ) ); Assert.AreEqual( "False", converter.ConvertToString( typeConverterOptions, false ) ); Assert.AreEqual( "", converter.ConvertToString( typeConverterOptions, null ) ); Assert.AreEqual( "1", converter.ConvertToString( typeConverterOptions, 1 ) ); }
public void ConvertToStringTest() { var converter = new BooleanConverter(); var propertyMapData = new CsvPropertyMapData( null ) { TypeConverter = converter, TypeConverterOptions = { CultureInfo = CultureInfo.CurrentCulture } }; Assert.AreEqual( "True", converter.ConvertToString( true, null, propertyMapData ) ); Assert.AreEqual( "False", converter.ConvertToString( false, null, propertyMapData ) ); Assert.AreEqual( "", converter.ConvertToString( null, null, propertyMapData ) ); Assert.AreEqual( "1", converter.ConvertToString( 1, null, propertyMapData ) ); }