@@ -72,8 +72,29 @@ public void GetColumns_DefaultValues_Succeeds()
7272 Assert . That ( binarycolumn1 . DefaultValue , Is . EqualTo ( new byte [ ] { 12 , 32 , 34 } ) ) ;
7373 }
7474
75- [ TestCase ( ) ]
76- public void GetColumns_DefaultValueBooleanValues_Succeeds ( string inboundBooleanDefaultValue , bool outboundBooleanDefaultValue )
75+ // 1 will coerce to true on inserts but not for default values in Postgre SQL - same for 0 to false
76+ // so we do not test it here
77+ [ TestCase ( "true" , true ) ]
78+ [ TestCase ( "TRUE" , true ) ]
79+ [ TestCase ( "t" , true ) ]
80+ [ TestCase ( "T" , true ) ]
81+ [ TestCase ( "yes" , true ) ]
82+ [ TestCase ( "YES" , true ) ]
83+ [ TestCase ( "y" , true ) ]
84+ [ TestCase ( "Y" , true ) ]
85+ [ TestCase ( "on" , true ) ]
86+ [ TestCase ( "ON" , true ) ]
87+ [ TestCase ( "false" , false ) ]
88+ [ TestCase ( "FALSE" , false ) ]
89+ [ TestCase ( "f" , false ) ]
90+ [ TestCase ( "F" , false ) ]
91+ [ TestCase ( "false" , false ) ]
92+ [ TestCase ( "FALSE" , false ) ]
93+ [ TestCase ( "n" , false ) ]
94+ [ TestCase ( "N" , false ) ]
95+ [ TestCase ( "off" , false ) ]
96+ [ TestCase ( "OFF" , false ) ]
97+ public void GetColumns_DefaultValueBooleanValues_Succeeds ( object inboundBooleanDefaultValue , bool outboundBooleanDefaultValue )
7798 {
7899 // Arrange
79100 var dateTimeDefaultValue = new DateTime ( 2000 , 1 , 2 , 3 , 4 , 5 , DateTimeKind . Utc ) ;
@@ -83,7 +104,7 @@ public void GetColumns_DefaultValueBooleanValues_Succeeds(string inboundBooleanD
83104 const string booleanColumnName1 = "booleancolumn1" ;
84105
85106 Provider . AddTable ( testTableName ,
86- new Column ( booleanColumnName1 , DbType . Boolean , true )
107+ new Column ( booleanColumnName1 , DbType . Boolean ) { DefaultValue = inboundBooleanDefaultValue }
87108 ) ;
88109
89110 // Act
@@ -92,6 +113,6 @@ public void GetColumns_DefaultValueBooleanValues_Succeeds(string inboundBooleanD
92113 // Assert
93114 var booleanColumn1 = columns . Single ( x => x . Name == booleanColumnName1 ) ;
94115
95- Assert . That ( booleanColumn1 . DefaultValue , Is . True ) ;
116+ Assert . That ( booleanColumn1 . DefaultValue , Is . EqualTo ( outboundBooleanDefaultValue ) ) ;
96117 }
97118}
0 commit comments