@@ -45,6 +45,40 @@ public GetValueConversionTests(SelectValueFixture fixture)
4545 public override void GetBoolean_throws_for_zero_UInt32 ( ) => TestGetValue ( DbType . UInt32 , ValueKind . Zero , x => x . GetBoolean ( 0 ) , false ) ;
4646 public override void GetBoolean_throws_for_zero_UInt64 ( ) => TestGetValue ( DbType . UInt64 , ValueKind . Zero , x => x . GetBoolean ( 0 ) , false ) ;
4747
48+ // GetByte allows integral conversions
49+ public override void GetByte_throws_for_maximum_Int16 ( ) => TestException ( DbType . Int16 , ValueKind . Maximum , x => x . GetByte ( 0 ) , typeof ( OverflowException ) ) ;
50+ public override void GetByte_throws_for_maximum_Int32 ( ) => TestException ( DbType . Int32 , ValueKind . Maximum , x => x . GetByte ( 0 ) , typeof ( OverflowException ) ) ;
51+ public override void GetByte_throws_for_maximum_Int64 ( ) => TestException ( DbType . Int64 , ValueKind . Maximum , x => x . GetByte ( 0 ) , typeof ( OverflowException ) ) ;
52+ public override void GetByte_throws_for_maximum_SByte ( ) => TestGetValue ( DbType . SByte , ValueKind . Maximum , x => x . GetByte ( 0 ) , ( byte ) 127 ) ;
53+ public override void GetByte_throws_for_maximum_UInt16 ( ) => TestException ( DbType . UInt16 , ValueKind . Maximum , x => x . GetByte ( 0 ) , typeof ( OverflowException ) ) ;
54+ public override void GetByte_throws_for_maximum_UInt32 ( ) => TestException ( DbType . UInt32 , ValueKind . Maximum , x => x . GetByte ( 0 ) , typeof ( OverflowException ) ) ;
55+ public override void GetByte_throws_for_maximum_UInt64 ( ) => TestException ( DbType . UInt64 , ValueKind . Maximum , x => x . GetByte ( 0 ) , typeof ( OverflowException ) ) ;
56+ public override void GetByte_throws_for_maximum_Decimal ( ) => TestException ( DbType . Decimal , ValueKind . Maximum , x => x . GetByte ( 0 ) , typeof ( OverflowException ) ) ;
57+ public override void GetByte_throws_for_minimum_Int16 ( ) => TestException ( DbType . Int16 , ValueKind . Minimum , x => x . GetByte ( 0 ) , typeof ( OverflowException ) ) ;
58+ public override void GetByte_throws_for_minimum_Int32 ( ) => TestException ( DbType . Int32 , ValueKind . Minimum , x => x . GetByte ( 0 ) , typeof ( OverflowException ) ) ;
59+ public override void GetByte_throws_for_minimum_Int64 ( ) => TestException ( DbType . Int64 , ValueKind . Minimum , x => x . GetByte ( 0 ) , typeof ( OverflowException ) ) ;
60+ public override void GetByte_throws_for_minimum_SByte ( ) => TestException ( DbType . SByte , ValueKind . Minimum , x => x . GetByte ( 0 ) , typeof ( OverflowException ) ) ;
61+ public override void GetByte_throws_for_minimum_UInt16 ( ) => TestGetValue ( DbType . UInt16 , ValueKind . Minimum , x => x . GetByte ( 0 ) , ( byte ) 0 ) ;
62+ public override void GetByte_throws_for_minimum_UInt32 ( ) => TestGetValue ( DbType . UInt32 , ValueKind . Minimum , x => x . GetByte ( 0 ) , ( byte ) 0 ) ;
63+ public override void GetByte_throws_for_minimum_UInt64 ( ) => TestGetValue ( DbType . UInt64 , ValueKind . Minimum , x => x . GetByte ( 0 ) , ( byte ) 0 ) ;
64+ public override void GetByte_throws_for_minimum_Decimal ( ) => TestGetValue ( DbType . Decimal , ValueKind . Minimum , x => x . GetByte ( 0 ) , ( byte ) 0 ) ;
65+ public override void GetByte_throws_for_one_Int16 ( ) => TestGetValue ( DbType . Int16 , ValueKind . One , x => x . GetByte ( 0 ) , ( byte ) 1 ) ;
66+ public override void GetByte_throws_for_one_Int32 ( ) => TestGetValue ( DbType . Int32 , ValueKind . One , x => x . GetByte ( 0 ) , ( byte ) 1 ) ;
67+ public override void GetByte_throws_for_one_Int64 ( ) => TestGetValue ( DbType . Int64 , ValueKind . One , x => x . GetByte ( 0 ) , ( byte ) 1 ) ;
68+ public override void GetByte_throws_for_one_SByte ( ) => TestGetValue ( DbType . SByte , ValueKind . One , x => x . GetByte ( 0 ) , ( byte ) 1 ) ;
69+ public override void GetByte_throws_for_one_UInt16 ( ) => TestGetValue ( DbType . UInt16 , ValueKind . One , x => x . GetByte ( 0 ) , ( byte ) 1 ) ;
70+ public override void GetByte_throws_for_one_UInt32 ( ) => TestGetValue ( DbType . UInt32 , ValueKind . One , x => x . GetByte ( 0 ) , ( byte ) 1 ) ;
71+ public override void GetByte_throws_for_one_UInt64 ( ) => TestGetValue ( DbType . UInt64 , ValueKind . One , x => x . GetByte ( 0 ) , ( byte ) 1 ) ;
72+ public override void GetByte_throws_for_one_Decimal ( ) => TestGetValue ( DbType . Decimal , ValueKind . One , x => x . GetByte ( 0 ) , ( byte ) 1 ) ;
73+ public override void GetByte_throws_for_zero_Int16 ( ) => TestGetValue ( DbType . Int16 , ValueKind . Zero , x => x . GetByte ( 0 ) , ( byte ) 0 ) ;
74+ public override void GetByte_throws_for_zero_Int32 ( ) => TestGetValue ( DbType . Int32 , ValueKind . Zero , x => x . GetByte ( 0 ) , ( byte ) 0 ) ;
75+ public override void GetByte_throws_for_zero_Int64 ( ) => TestGetValue ( DbType . Int64 , ValueKind . Zero , x => x . GetByte ( 0 ) , ( byte ) 0 ) ;
76+ public override void GetByte_throws_for_zero_SByte ( ) => TestGetValue ( DbType . SByte , ValueKind . Zero , x => x . GetByte ( 0 ) , ( byte ) 0 ) ;
77+ public override void GetByte_throws_for_zero_UInt16 ( ) => TestGetValue ( DbType . UInt16 , ValueKind . Zero , x => x . GetByte ( 0 ) , ( byte ) 0 ) ;
78+ public override void GetByte_throws_for_zero_UInt32 ( ) => TestGetValue ( DbType . UInt32 , ValueKind . Zero , x => x . GetByte ( 0 ) , ( byte ) 0 ) ;
79+ public override void GetByte_throws_for_zero_UInt64 ( ) => TestGetValue ( DbType . UInt64 , ValueKind . Zero , x => x . GetByte ( 0 ) , ( byte ) 0 ) ;
80+ public override void GetByte_throws_for_zero_Decimal ( ) => TestGetValue ( DbType . Decimal , ValueKind . Zero , x => x . GetByte ( 0 ) , ( byte ) 0 ) ;
81+
4882 // the minimum date permitted by MySQL is 1000-01-01; override the minimum value for DateTime tests
4983 public override void GetDateTime_for_minimum_Date ( ) => TestGetValue ( DbType . Date , ValueKind . Minimum , x => x . GetDateTime ( 0 ) , new DateTime ( 1000 , 1 , 1 ) ) ;
5084 public override void GetDateTime_for_minimum_DateTime ( ) => TestGetValue ( DbType . Date , ValueKind . Minimum , x => x . GetDateTime ( 0 ) , new DateTime ( 1000 , 1 , 1 ) ) ;
0 commit comments