NullableTypes/src/Tests DBNullConvertTest.cs,1.4,1.5
Status: Inactive
Brought to you by:
lukadotnet
From: Damien G. <dam...@us...> - 2005-10-25 11:52:29
|
Update of /cvsroot/nullabletypes/NullableTypes/src/Tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27251/src/Tests Modified Files: DBNullConvertTest.cs Log Message: Added tests for NullableTimeSpan exceptions when passed String or Int64. Index: DBNullConvertTest.cs =================================================================== RCS file: /cvsroot/nullabletypes/NullableTypes/src/Tests/DBNullConvertTest.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** DBNullConvertTest.cs 6 Oct 2005 16:05:35 -0000 1.4 --- DBNullConvertTest.cs 25 Oct 2005 11:52:20 -0000 1.5 *************** *** 9,14 **** // NullableTypes.HelperFunctions as for DBNullConvert class // 06-Oct-2003 Luca Upgrade Code upgrade: Replaced tabs with spaces ! // 05-Sep-2005 DamienG Upgrade Added tests for NullableGuid conversion ! // 26-Sep-2005 DamienG Upgrade Added tests for NullableTimeSpan conversion // --- 9,15 ---- // NullableTypes.HelperFunctions as for DBNullConvert class // 06-Oct-2003 Luca Upgrade Code upgrade: Replaced tabs with spaces ! // 05-Sep-2005 DamienG Upgrade Added tests for NullableGuid conversion. ! // 26-Sep-2005 DamienG Upgrade Added tests for NullableTimeSpan conversion. ! // 25-Oct-2005 DamienG Upgrade Added tests for NullableTimeSpan exceptions when passed String or Int64. // *************** *** 539,549 **** - [nu.Test, nu.ExpectedException(typeof(sys.FormatException))] - public void ToNullableTimeSpanInvalidCastException() - { - DBNullConvert.ToNullableTimeSpan("invalid"); - } - - [nu.Test, nu.ExpectedException(typeof(sys.ArgumentNullException))] public void ToNullableTimeSpanArgumentNullException() --- 540,543 ---- *************** *** 552,555 **** --- 546,568 ---- } + + [nu.Test, nu.ExpectedException(typeof(sys.InvalidCastException))] + public void ToNullableTimeSpanCastException() { + _dbTable.Columns.Add("System.String", typeof(string)); + _dbTable.Rows.Add(new object[] {false}); + + DBNullConvert.ToNullableTimeSpan(_dbTable.Rows[0][0]); + } + + + [nu.Test, nu.ExpectedException(typeof(sys.InvalidCastException))] + public void ToNullableTimeSpanCastException2() { + _dbTable.Columns.Add("System.Int64", typeof(long)); + _dbTable.Rows.Add(new object[] {false}); + + DBNullConvert.ToNullableTimeSpan(_dbTable.Rows[0][0]); + } + + #endregion // DbValue to NullableTypes Tests - A# |