From: Donald L M. Jr. <lu...@us...> - 2005-02-08 19:15:15
|
Update of /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17703/src/Nullables.Tests Modified Files: NullableBooleanFixture.cs NullableByteFixture.cs NullableDateTimeFixture.cs NullableDecimalFixture.cs NullableDoubleFixture.cs NullableGuidFixture.cs NullableInt16Fixture.cs NullableInt32Fixture.cs NullableInt64Fixture.cs NullableSByteFixture.cs NullableSingleFixture.cs Log Message: Changed the behavior of Nullables.Value (getter) to throw an InvalidOperationException when there is no value (null). This was intended (but forgotten). Index: NullableBooleanFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableBooleanFixture.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NullableBooleanFixture.cs 16 Dec 2004 15:26:13 -0000 1.3 --- NullableBooleanFixture.cs 8 Feb 2005 19:12:47 -0000 1.4 *************** *** 35,38 **** --- 35,46 ---- Assert.IsTrue( y.CompareTo( x ) > 0 ); } + + [Test, ExpectedException(typeof(InvalidOperationException))] + public void BooleanMissingValueTest() + { + NullableBoolean x = NullableBoolean.Default; + + bool y = x.Value; + } } } \ No newline at end of file Index: NullableGuidFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableGuidFixture.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NullableGuidFixture.cs 16 Dec 2004 15:26:13 -0000 1.3 --- NullableGuidFixture.cs 8 Feb 2005 19:12:53 -0000 1.4 *************** *** 42,45 **** --- 42,53 ---- } + [Test, ExpectedException(typeof(InvalidOperationException))] + public void GuidMissingValueTest() + { + NullableGuid x = NullableGuid.Default; + + Guid y = x.Value; + } + [Test] public void GuidIComparableTest() Index: NullableDateTimeFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableDateTimeFixture.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NullableDateTimeFixture.cs 16 Dec 2004 15:26:13 -0000 1.3 --- NullableDateTimeFixture.cs 8 Feb 2005 19:12:48 -0000 1.4 *************** *** 42,45 **** --- 42,53 ---- } + [Test, ExpectedException(typeof(InvalidOperationException))] + public void DateTimeMissingValueTest() + { + NullableDateTime x = NullableDateTime.Default; + + DateTime y = x.Value; + } + [Test] public void DateTimeIComparableTest() Index: NullableInt16Fixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableInt16Fixture.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NullableInt16Fixture.cs 16 Dec 2004 15:26:13 -0000 1.3 --- NullableInt16Fixture.cs 8 Feb 2005 19:12:53 -0000 1.4 *************** *** 42,45 **** --- 42,53 ---- } + [Test, ExpectedException(typeof(InvalidOperationException))] + public void Int16MissingValueTest() + { + NullableInt16 x = NullableInt16.Default; + + Int16 y = x.Value; + } + [Test] public void Int16IComparableTest() Index: NullableDoubleFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableDoubleFixture.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NullableDoubleFixture.cs 16 Dec 2004 15:26:13 -0000 1.3 --- NullableDoubleFixture.cs 8 Feb 2005 19:12:52 -0000 1.4 *************** *** 42,45 **** --- 42,53 ---- } + [Test, ExpectedException(typeof(InvalidOperationException))] + public void DoubleMissingValueTest() + { + NullableDouble x = NullableDouble.Default; + + double y = x.Value; + } + [Test] public void DoubleIComparableTest() Index: NullableInt64Fixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableInt64Fixture.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NullableInt64Fixture.cs 16 Dec 2004 15:26:13 -0000 1.3 --- NullableInt64Fixture.cs 8 Feb 2005 19:12:53 -0000 1.4 *************** *** 42,45 **** --- 42,53 ---- } + [Test, ExpectedException(typeof(InvalidOperationException))] + public void Int64MissingValueTest() + { + NullableInt64 x = NullableInt64.Default; + + Int64 y = x.Value; + } + [Test] public void Int64IComparableTest() Index: NullableDecimalFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableDecimalFixture.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NullableDecimalFixture.cs 16 Dec 2004 15:26:13 -0000 1.3 --- NullableDecimalFixture.cs 8 Feb 2005 19:12:50 -0000 1.4 *************** *** 42,45 **** --- 42,53 ---- } + [Test, ExpectedException(typeof(InvalidOperationException))] + public void DecimalMissingValueTest() + { + NullableDecimal x = NullableDecimal.Default; + + decimal y = x.Value; + } + [Test] public void DecimalIComparableTest() Index: NullableSByteFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableSByteFixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullableSByteFixture.cs 16 Dec 2004 15:26:13 -0000 1.2 --- NullableSByteFixture.cs 8 Feb 2005 19:12:53 -0000 1.3 *************** *** 46,49 **** --- 46,57 ---- } + [Test, ExpectedException(typeof(InvalidOperationException))] + public void SByteMissingValueTest() + { + NullableSByte x = NullableSByte.Default; + + SByte y = x.Value; + } + [Test] public void SByteIComparableTest() Index: NullableSingleFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableSingleFixture.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NullableSingleFixture.cs 16 Dec 2004 15:26:13 -0000 1.3 --- NullableSingleFixture.cs 8 Feb 2005 19:12:53 -0000 1.4 *************** *** 42,45 **** --- 42,53 ---- } + [Test, ExpectedException(typeof(InvalidOperationException))] + public void SingleMissingValueTest() + { + NullableSingle x = NullableSingle.Default; + + float y = x.Value; + } + [Test] public void SingleIComparableTest() Index: NullableByteFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableByteFixture.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NullableByteFixture.cs 16 Dec 2004 15:26:13 -0000 1.3 --- NullableByteFixture.cs 8 Feb 2005 19:12:48 -0000 1.4 *************** *** 42,45 **** --- 42,53 ---- } + [Test, ExpectedException(typeof(InvalidOperationException))] + public void ByteMissingValueTest() + { + NullableByte x = NullableByte.Default; + + byte y = x.Value; + } + [Test] public void ByteIComparableTest() Index: NullableInt32Fixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableInt32Fixture.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NullableInt32Fixture.cs 16 Dec 2004 15:26:13 -0000 1.3 --- NullableInt32Fixture.cs 8 Feb 2005 19:12:53 -0000 1.4 *************** *** 37,40 **** --- 37,41 ---- Assert.IsFalse( v2.HasValue ); + Assert.IsFalse( v2.Equals( 12 ) ); Assert.IsTrue( v2.Equals( NullableInt32.Default ) ); *************** *** 43,46 **** --- 44,55 ---- } + [Test, ExpectedException(typeof(InvalidOperationException))] + public void Int32MissingValueTest() + { + NullableInt32 x = NullableInt32.Default; + + int y = x.Value; + } + [Test] public void Int32IComparableTest() |