From: Michael D. <mik...@us...> - 2004-12-16 15:26:29
|
Update of /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23953/src/Nullables.Tests Modified Files: NullableBooleanFixture.cs NullableByteFixture.cs NullableDateTimeFixture.cs NullableDecimalFixture.cs NullableDoubleFixture.cs NullableGuidFixture.cs NullableInt16Fixture.cs NullableInt32Fixture.cs NullableInt64Fixture.cs Nullables.Tests-1.1.csproj NullableSByteFixture.cs NullableSingleFixture.cs Log Message: playing around with ReSharper. Did some formatting changes. Index: NullableBooleanFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableBooleanFixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullableBooleanFixture.cs 10 Dec 2004 18:24:20 -0000 1.2 --- NullableBooleanFixture.cs 16 Dec 2004 15:26:13 -0000 1.3 *************** *** 1,6 **** using System; - using Nullables; - using NUnit.Framework; --- 1,4 ---- *************** *** 13,23 **** public class NullableBooleanFixture { - public NullableBooleanFixture() - { - // - // TODO: Add constructor logic here - // - } - [Test] public void BooleanIComparableTest() --- 11,14 ---- *************** *** 28,47 **** //one null, one not x = NullableBoolean.Default; ! y = new NullableBoolean(true); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); //now both null x = NullableBoolean.Default; y = NullableBoolean.Default; ! Assert.IsTrue(x.CompareTo(y) == 0); ! Assert.IsTrue(y.CompareTo(x) == 0); //now both with a value ! x = new NullableBoolean(false); ! y = new NullableBoolean(true); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); } } ! } --- 19,38 ---- //one null, one not x = NullableBoolean.Default; ! y = new NullableBoolean( true ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); //now both null x = NullableBoolean.Default; y = NullableBoolean.Default; ! Assert.IsTrue( x.CompareTo( y ) == 0 ); ! Assert.IsTrue( y.CompareTo( x ) == 0 ); //now both with a value ! x = new NullableBoolean( false ); ! y = new NullableBoolean( true ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); } } ! } \ No newline at end of file Index: NullableDateTimeFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableDateTimeFixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullableDateTimeFixture.cs 10 Dec 2004 18:24:20 -0000 1.2 --- NullableDateTimeFixture.cs 16 Dec 2004 15:26:13 -0000 1.3 *************** *** 1,6 **** using System; - using Nullables; - using NUnit.Framework; --- 1,4 ---- *************** *** 16,45 **** public void BasicTestDateTime() { ! NullableDateTime v1 = new DateTime(1979, 11, 8); ! Assert.IsTrue(v1.HasValue); //should have a value; ! Assert.IsTrue(v1.Equals(new DateTime(1979, 11, 8))); //implicit casting should make this result in true. ! Assert.IsTrue(v1.Value == new DateTime(1979, 11, 8)); ! Assert.IsFalse(v1.Equals(NullableDateTime.Default)); ! Assert.IsTrue(v1.Equals(new NullableDateTime(new DateTime(1979, 11, 8)))); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue(v1 == new DateTime(1979, 11, 8)); ! Assert.IsFalse(v1 == new DateTime(1980, 10, 9)); ! Assert.IsFalse(v1 == NullableDateTime.Default); ! Assert.IsTrue(v1 == new NullableDateTime(new DateTime(1979, 11, 8))); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue(v1 == NullableDateTime.Default); v1 = NullableDateTime.Default; ! Assert.IsTrue(v1 == NullableDateTime.Default); NullableDateTime v2 = NullableDateTime.Default; //should start as "null" ! Assert.IsFalse(v2.HasValue); ! Assert.IsFalse(v2.Equals(new DateTime(2004, 12, 25))); ! Assert.IsTrue(v2.Equals(NullableDateTime.Default)); ! Assert.IsTrue(v2.Equals(DBNull.Value)); } --- 14,43 ---- public void BasicTestDateTime() { ! NullableDateTime v1 = new DateTime( 1979, 11, 8 ); ! Assert.IsTrue( v1.HasValue ); //should have a value; ! Assert.IsTrue( v1.Equals( new DateTime( 1979, 11, 8 ) ) ); //implicit casting should make this result in true. ! Assert.IsTrue( v1.Value == new DateTime( 1979, 11, 8 ) ); ! Assert.IsFalse( v1.Equals( NullableDateTime.Default ) ); ! Assert.IsTrue( v1.Equals( new NullableDateTime( new DateTime( 1979, 11, 8 ) ) ) ); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue( v1 == new DateTime( 1979, 11, 8 ) ); ! Assert.IsFalse( v1 == new DateTime( 1980, 10, 9 ) ); ! Assert.IsFalse( v1 == NullableDateTime.Default ); ! Assert.IsTrue( v1 == new NullableDateTime( new DateTime( 1979, 11, 8 ) ) ); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue( v1 == NullableDateTime.Default ); v1 = NullableDateTime.Default; ! Assert.IsTrue( v1 == NullableDateTime.Default ); NullableDateTime v2 = NullableDateTime.Default; //should start as "null" ! Assert.IsFalse( v2.HasValue ); ! Assert.IsFalse( v2.Equals( new DateTime( 2004, 12, 25 ) ) ); ! Assert.IsTrue( v2.Equals( NullableDateTime.Default ) ); ! Assert.IsTrue( v2.Equals( DBNull.Value ) ); } *************** *** 52,71 **** //one null, one not x = NullableDateTime.Default; ! y = new NullableDateTime(new DateTime(2000, 12, 25)); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); //now both null x = NullableDateTime.Default; y = NullableDateTime.Default; ! Assert.IsTrue(x.CompareTo(y) == 0); ! Assert.IsTrue(y.CompareTo(x) == 0); //now both with a value ! x = new NullableDateTime(new DateTime(2000, 11, 1)); ! y = new NullableDateTime(new DateTime(2000, 12, 25)); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); } } ! } --- 50,69 ---- //one null, one not x = NullableDateTime.Default; ! y = new NullableDateTime( new DateTime( 2000, 12, 25 ) ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); //now both null x = NullableDateTime.Default; y = NullableDateTime.Default; ! Assert.IsTrue( x.CompareTo( y ) == 0 ); ! Assert.IsTrue( y.CompareTo( x ) == 0 ); //now both with a value ! x = new NullableDateTime( new DateTime( 2000, 11, 1 ) ); ! y = new NullableDateTime( new DateTime( 2000, 12, 25 ) ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); } } ! } \ No newline at end of file Index: NullableGuidFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableGuidFixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullableGuidFixture.cs 10 Dec 2004 18:24:20 -0000 1.2 --- NullableGuidFixture.cs 16 Dec 2004 15:26:13 -0000 1.3 *************** *** 1,6 **** using System; - using Nullables; - using NUnit.Framework; --- 1,4 ---- *************** *** 16,45 **** public void BasicTestGuid() { ! NullableGuid v1 = new Guid("00000000-0000-0000-0000-000000000005"); //should take an int literal ! Assert.IsTrue(v1.HasValue); //should have a value; ! Assert.IsTrue(v1.Equals(new Guid("00000000-0000-0000-0000-000000000005"))); //implicit casting should make this result in true. ! Assert.IsTrue(v1.Value == new Guid("00000000-0000-0000-0000-000000000005")); ! Assert.IsFalse(v1.Equals(NullableGuid.Default)); ! Assert.IsTrue(v1.Equals(new NullableGuid(new Guid("00000000-0000-0000-0000-000000000005")))); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue(v1 == new Guid("00000000-0000-0000-0000-000000000005")); ! Assert.IsFalse(v1 == new Guid("00000000-0000-0000-0000-000000000008")); ! Assert.IsFalse(v1 == NullableGuid.Default); ! Assert.IsTrue(v1 == new NullableGuid(new Guid("00000000-0000-0000-0000-000000000005"))); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue(v1 == NullableGuid.Default); v1 = NullableGuid.Default; ! Assert.IsTrue(v1 == NullableGuid.Default); NullableGuid v2 = NullableGuid.Default; //should start as "null" ! Assert.IsFalse(v2.HasValue); ! Assert.IsFalse(v2.Equals(new Guid("00000000-0000-0000-0000-000000000002"))); ! Assert.IsTrue(v2.Equals(NullableGuid.Default)); ! Assert.IsTrue(v2.Equals(DBNull.Value)); } --- 14,43 ---- public void BasicTestGuid() { ! NullableGuid v1 = new Guid( "00000000-0000-0000-0000-000000000005" ); //should take an int literal ! Assert.IsTrue( v1.HasValue ); //should have a value; ! Assert.IsTrue( v1.Equals( new Guid( "00000000-0000-0000-0000-000000000005" ) ) ); //implicit casting should make this result in true. ! Assert.IsTrue( v1.Value == new Guid( "00000000-0000-0000-0000-000000000005" ) ); ! Assert.IsFalse( v1.Equals( NullableGuid.Default ) ); ! Assert.IsTrue( v1.Equals( new NullableGuid( new Guid( "00000000-0000-0000-0000-000000000005" ) ) ) ); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue( v1 == new Guid( "00000000-0000-0000-0000-000000000005" ) ); ! Assert.IsFalse( v1 == new Guid( "00000000-0000-0000-0000-000000000008" ) ); ! Assert.IsFalse( v1 == NullableGuid.Default ); ! Assert.IsTrue( v1 == new NullableGuid( new Guid( "00000000-0000-0000-0000-000000000005" ) ) ); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue( v1 == NullableGuid.Default ); v1 = NullableGuid.Default; ! Assert.IsTrue( v1 == NullableGuid.Default ); NullableGuid v2 = NullableGuid.Default; //should start as "null" ! Assert.IsFalse( v2.HasValue ); ! Assert.IsFalse( v2.Equals( new Guid( "00000000-0000-0000-0000-000000000002" ) ) ); ! Assert.IsTrue( v2.Equals( NullableGuid.Default ) ); ! Assert.IsTrue( v2.Equals( DBNull.Value ) ); } *************** *** 52,71 **** //one null, one not x = NullableGuid.Default; ! y = new NullableGuid(new Guid("12345678-1234-1234-1234-123456789012")); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); //now both null x = NullableGuid.Default; y = NullableGuid.Default; ! Assert.IsTrue(x.CompareTo(y) == 0); ! Assert.IsTrue(y.CompareTo(x) == 0); //now both with a value ! x = new NullableGuid(new Guid("12345678-1234-1234-1234-123456789001")); ! y = new NullableGuid(new Guid("12345678-1234-1234-1234-123456789099")); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); } } ! } --- 50,69 ---- //one null, one not x = NullableGuid.Default; ! y = new NullableGuid( new Guid( "12345678-1234-1234-1234-123456789012" ) ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); //now both null x = NullableGuid.Default; y = NullableGuid.Default; ! Assert.IsTrue( x.CompareTo( y ) == 0 ); ! Assert.IsTrue( y.CompareTo( x ) == 0 ); //now both with a value ! x = new NullableGuid( new Guid( "12345678-1234-1234-1234-123456789001" ) ); ! y = new NullableGuid( new Guid( "12345678-1234-1234-1234-123456789099" ) ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); } } ! } \ No newline at end of file Index: NullableInt16Fixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableInt16Fixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullableInt16Fixture.cs 10 Dec 2004 18:24:20 -0000 1.2 --- NullableInt16Fixture.cs 16 Dec 2004 15:26:13 -0000 1.3 *************** *** 1,6 **** using System; - using Nullables; - using NUnit.Framework; --- 1,4 ---- *************** *** 18,45 **** NullableInt16 v1 = 32; //should take an int literal ! Assert.IsTrue(v1.HasValue); //should have a value; ! Assert.IsTrue(v1.Equals(32)); //implicit casting should make this result in true. ! Assert.IsTrue(v1.Value == 32); ! Assert.IsFalse(v1.Equals(NullableInt16.Default)); ! Assert.IsTrue(v1.Equals(new NullableInt16(32))); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue(v1 == 32); ! Assert.IsFalse(v1 == 33); ! Assert.IsFalse(v1 == NullableInt16.Default); ! Assert.IsTrue(v1 == new NullableInt16(32)); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue(v1 == NullableInt16.Default); v1 = NullableInt16.Default; ! Assert.IsTrue(v1 == NullableInt16.Default); NullableInt16 v2 = NullableInt16.Default; //should start as "null" ! Assert.IsFalse(v2.HasValue); ! Assert.IsFalse(v2.Equals(12)); ! Assert.IsTrue(v2.Equals(NullableInt16.Default)); ! Assert.IsTrue(v2.Equals(DBNull.Value)); } --- 16,43 ---- NullableInt16 v1 = 32; //should take an int literal ! Assert.IsTrue( v1.HasValue ); //should have a value; ! Assert.IsTrue( v1.Equals( 32 ) ); //implicit casting should make this result in true. ! Assert.IsTrue( v1.Value == 32 ); ! Assert.IsFalse( v1.Equals( NullableInt16.Default ) ); ! Assert.IsTrue( v1.Equals( new NullableInt16( 32 ) ) ); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue( v1 == 32 ); ! Assert.IsFalse( v1 == 33 ); ! Assert.IsFalse( v1 == NullableInt16.Default ); ! Assert.IsTrue( v1 == new NullableInt16( 32 ) ); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue( v1 == NullableInt16.Default ); v1 = NullableInt16.Default; ! Assert.IsTrue( v1 == NullableInt16.Default ); NullableInt16 v2 = NullableInt16.Default; //should start as "null" ! Assert.IsFalse( v2.HasValue ); ! Assert.IsFalse( v2.Equals( 12 ) ); ! Assert.IsTrue( v2.Equals( NullableInt16.Default ) ); ! Assert.IsTrue( v2.Equals( DBNull.Value ) ); } *************** *** 52,71 **** //one null, one not x = NullableInt16.Default; ! y = new NullableInt16(16); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); //now both null x = NullableInt16.Default; y = NullableInt16.Default; ! Assert.IsTrue(x.CompareTo(y) == 0); ! Assert.IsTrue(y.CompareTo(x) == 0); //now both with a value ! x = new NullableInt16(5); ! y = new NullableInt16(43); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); } } ! } --- 50,69 ---- //one null, one not x = NullableInt16.Default; ! y = new NullableInt16( 16 ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); //now both null x = NullableInt16.Default; y = NullableInt16.Default; ! Assert.IsTrue( x.CompareTo( y ) == 0 ); ! Assert.IsTrue( y.CompareTo( x ) == 0 ); //now both with a value ! x = new NullableInt16( 5 ); ! y = new NullableInt16( 43 ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); } } ! } \ No newline at end of file Index: NullableDoubleFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableDoubleFixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullableDoubleFixture.cs 10 Dec 2004 18:24:20 -0000 1.2 --- NullableDoubleFixture.cs 16 Dec 2004 15:26:13 -0000 1.3 *************** *** 1,6 **** using System; - using Nullables; - using NUnit.Framework; --- 1,4 ---- *************** *** 18,45 **** NullableDouble v1 = 32; //should take an int literal ! Assert.IsTrue(v1.HasValue); //should have a value; ! Assert.IsTrue(v1.Equals(32)); //implicit casting should make this result in true. ! Assert.IsTrue(v1.Value == 32); ! Assert.IsFalse(v1.Equals(NullableDouble.Default)); ! Assert.IsTrue(v1.Equals(new NullableDouble(32))); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue(v1 == 32); ! Assert.IsFalse(v1 == 33); ! Assert.IsFalse(v1 == NullableDouble.Default); ! Assert.IsTrue(v1 == new NullableDouble(32)); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue(v1 == NullableDouble.Default); v1 = NullableDouble.Default; ! Assert.IsTrue(v1 == NullableDouble.Default); NullableDouble v2 = NullableDouble.Default; //should start as "null" ! Assert.IsFalse(v2.HasValue); ! Assert.IsFalse(v2.Equals(12)); ! Assert.IsTrue(v2.Equals(NullableDouble.Default)); ! Assert.IsTrue(v2.Equals(DBNull.Value)); } --- 16,43 ---- NullableDouble v1 = 32; //should take an int literal ! Assert.IsTrue( v1.HasValue ); //should have a value; ! Assert.IsTrue( v1.Equals( 32 ) ); //implicit casting should make this result in true. ! Assert.IsTrue( v1.Value == 32 ); ! Assert.IsFalse( v1.Equals( NullableDouble.Default ) ); ! Assert.IsTrue( v1.Equals( new NullableDouble( 32 ) ) ); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue( v1 == 32 ); ! Assert.IsFalse( v1 == 33 ); ! Assert.IsFalse( v1 == NullableDouble.Default ); ! Assert.IsTrue( v1 == new NullableDouble( 32 ) ); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue( v1 == NullableDouble.Default ); v1 = NullableDouble.Default; ! Assert.IsTrue( v1 == NullableDouble.Default ); NullableDouble v2 = NullableDouble.Default; //should start as "null" ! Assert.IsFalse( v2.HasValue ); ! Assert.IsFalse( v2.Equals( 12 ) ); ! Assert.IsTrue( v2.Equals( NullableDouble.Default ) ); ! Assert.IsTrue( v2.Equals( DBNull.Value ) ); } *************** *** 52,71 **** //one null, one not x = NullableDouble.Default; ! y = new NullableDouble(0.5); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); //now both null x = NullableDouble.Default; y = NullableDouble.Default; ! Assert.IsTrue(x.CompareTo(y) == 0); ! Assert.IsTrue(y.CompareTo(x) == 0); //now both with a value ! x = new NullableDouble(0.6); ! y = new NullableDouble(0.67); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); } } ! } --- 50,69 ---- //one null, one not x = NullableDouble.Default; ! y = new NullableDouble( 0.5 ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); //now both null x = NullableDouble.Default; y = NullableDouble.Default; ! Assert.IsTrue( x.CompareTo( y ) == 0 ); ! Assert.IsTrue( y.CompareTo( x ) == 0 ); //now both with a value ! x = new NullableDouble( 0.6 ); ! y = new NullableDouble( 0.67 ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); } } ! } \ No newline at end of file Index: NullableInt64Fixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableInt64Fixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullableInt64Fixture.cs 10 Dec 2004 18:24:20 -0000 1.2 --- NullableInt64Fixture.cs 16 Dec 2004 15:26:13 -0000 1.3 *************** *** 1,6 **** using System; - using Nullables; - using NUnit.Framework; --- 1,4 ---- *************** *** 18,45 **** NullableInt64 v1 = 46816684; //should take an int literal ! Assert.IsTrue(v1.HasValue); //should have a value; ! Assert.IsTrue(v1.Equals(46816684)); //implicit casting should make this result in true. ! Assert.IsTrue(v1.Value == 46816684); ! Assert.IsFalse(v1.Equals(NullableInt64.Default)); ! Assert.IsTrue(v1.Equals(new NullableInt64(46816684))); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue(v1 == 46816684); ! Assert.IsFalse(v1 == 448494894); ! Assert.IsFalse(v1 == NullableInt64.Default); ! Assert.IsTrue(v1 == new NullableInt64(46816684)); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue(v1 == NullableInt64.Default); v1 = NullableInt64.Default; ! Assert.IsTrue(v1 == NullableInt64.Default); NullableInt64 v2 = NullableInt64.Default; //should start as "null" ! Assert.IsFalse(v2.HasValue); ! Assert.IsFalse(v2.Equals(4484)); ! Assert.IsTrue(v2.Equals(NullableInt64.Default)); ! Assert.IsTrue(v2.Equals(DBNull.Value)); } --- 16,43 ---- NullableInt64 v1 = 46816684; //should take an int literal ! Assert.IsTrue( v1.HasValue ); //should have a value; ! Assert.IsTrue( v1.Equals( 46816684 ) ); //implicit casting should make this result in true. ! Assert.IsTrue( v1.Value == 46816684 ); ! Assert.IsFalse( v1.Equals( NullableInt64.Default ) ); ! Assert.IsTrue( v1.Equals( new NullableInt64( 46816684 ) ) ); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue( v1 == 46816684 ); ! Assert.IsFalse( v1 == 448494894 ); ! Assert.IsFalse( v1 == NullableInt64.Default ); ! Assert.IsTrue( v1 == new NullableInt64( 46816684 ) ); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue( v1 == NullableInt64.Default ); v1 = NullableInt64.Default; ! Assert.IsTrue( v1 == NullableInt64.Default ); NullableInt64 v2 = NullableInt64.Default; //should start as "null" ! Assert.IsFalse( v2.HasValue ); ! Assert.IsFalse( v2.Equals( 4484 ) ); ! Assert.IsTrue( v2.Equals( NullableInt64.Default ) ); ! Assert.IsTrue( v2.Equals( DBNull.Value ) ); } *************** *** 52,70 **** //one null, one not x = NullableInt64.Default; ! y = new NullableInt64(16); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); //now both null x = NullableInt64.Default; y = NullableInt64.Default; ! Assert.IsTrue(x.CompareTo(y) == 0); ! Assert.IsTrue(y.CompareTo(x) == 0); //now both with a value ! x = new NullableInt64(5); ! y = new NullableInt64(43); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); } --- 50,68 ---- //one null, one not x = NullableInt64.Default; ! y = new NullableInt64( 16 ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); //now both null x = NullableInt64.Default; y = NullableInt64.Default; ! Assert.IsTrue( x.CompareTo( y ) == 0 ); ! Assert.IsTrue( y.CompareTo( x ) == 0 ); //now both with a value ! x = new NullableInt64( 5 ); ! y = new NullableInt64( 43 ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); } Index: NullableDecimalFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableDecimalFixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullableDecimalFixture.cs 10 Dec 2004 18:24:20 -0000 1.2 --- NullableDecimalFixture.cs 16 Dec 2004 15:26:13 -0000 1.3 *************** *** 1,6 **** using System; - using Nullables; - using NUnit.Framework; --- 1,4 ---- *************** *** 18,45 **** NullableDecimal v1 = 4.99m; //should take an int literal ! Assert.IsTrue(v1.HasValue); //should have a value; ! Assert.IsTrue(v1.Equals(4.99m)); //implicit casting should make this result in true. ! Assert.IsTrue(v1.Value == 4.99m); ! Assert.IsFalse(v1.Equals(NullableDecimal.Default)); ! Assert.IsTrue(v1.Equals(new NullableDecimal(4.99m))); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue(v1 == 4.99m); ! Assert.IsFalse(v1 == 5.01m); ! Assert.IsFalse(v1 == NullableDecimal.Default); ! Assert.IsTrue(v1 == new NullableDecimal(4.99m)); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue(v1 == NullableDecimal.Default); v1 = NullableDecimal.Default; ! Assert.IsTrue(v1 == NullableDecimal.Default); NullableDecimal v2 = NullableDecimal.Default; //should start as "null" ! Assert.IsFalse(v2.HasValue); ! Assert.IsFalse(v2.Equals(4.01m)); ! Assert.IsTrue(v2.Equals(NullableDecimal.Default)); ! Assert.IsTrue(v2.Equals(DBNull.Value)); } --- 16,43 ---- NullableDecimal v1 = 4.99m; //should take an int literal ! Assert.IsTrue( v1.HasValue ); //should have a value; ! Assert.IsTrue( v1.Equals( 4.99m ) ); //implicit casting should make this result in true. ! Assert.IsTrue( v1.Value == 4.99m ); ! Assert.IsFalse( v1.Equals( NullableDecimal.Default ) ); ! Assert.IsTrue( v1.Equals( new NullableDecimal( 4.99m ) ) ); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue( v1 == 4.99m ); ! Assert.IsFalse( v1 == 5.01m ); ! Assert.IsFalse( v1 == NullableDecimal.Default ); ! Assert.IsTrue( v1 == new NullableDecimal( 4.99m ) ); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue( v1 == NullableDecimal.Default ); v1 = NullableDecimal.Default; ! Assert.IsTrue( v1 == NullableDecimal.Default ); NullableDecimal v2 = NullableDecimal.Default; //should start as "null" ! Assert.IsFalse( v2.HasValue ); ! Assert.IsFalse( v2.Equals( 4.01m ) ); ! Assert.IsTrue( v2.Equals( NullableDecimal.Default ) ); ! Assert.IsTrue( v2.Equals( DBNull.Value ) ); } *************** *** 52,71 **** //one null, one not x = NullableDecimal.Default; ! y = new NullableDecimal(10.03m); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); //now both null x = NullableDecimal.Default; y = NullableDecimal.Default; ! Assert.IsTrue(x.CompareTo(y) == 0); ! Assert.IsTrue(y.CompareTo(x) == 0); //now both with a value ! x = new NullableDecimal(15.3m); ! y = new NullableDecimal(18.02m); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); } } ! } --- 50,69 ---- //one null, one not x = NullableDecimal.Default; ! y = new NullableDecimal( 10.03m ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); //now both null x = NullableDecimal.Default; y = NullableDecimal.Default; ! Assert.IsTrue( x.CompareTo( y ) == 0 ); ! Assert.IsTrue( y.CompareTo( x ) == 0 ); //now both with a value ! x = new NullableDecimal( 15.3m ); ! y = new NullableDecimal( 18.02m ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); } } ! } \ No newline at end of file Index: NullableSByteFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableSByteFixture.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NullableSByteFixture.cs 10 Dec 2004 18:24:20 -0000 1.1 --- NullableSByteFixture.cs 16 Dec 2004 15:26:13 -0000 1.2 *************** *** 1,6 **** using System; - using Nullables; - using NUnit.Framework; --- 1,4 ---- *************** *** 18,49 **** [Test] ! public void BasicTestSByte() { NullableSByte v1 = 32; //should take an int literal ! Assert.IsTrue(v1.HasValue); //should have a value; ! Assert.IsTrue(v1.Equals(32)); //implicit casting should make this result in true. ! Assert.IsTrue(v1.Value == 32); ! Assert.IsFalse(v1.Equals(NullableSByte.Default)); ! Assert.IsTrue(v1.Equals(new NullableSByte(32))); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue(v1 == 32); ! Assert.IsFalse(v1 == 33); ! Assert.IsFalse(v1 == NullableSByte.Default); ! Assert.IsTrue(v1 == new NullableSByte(32)); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue(v1 == NullableSByte.Default); v1 = NullableSByte.Default; ! Assert.IsTrue(v1 == NullableSByte.Default); NullableSByte v2 = NullableSByte.Default; //should start as "null" ! Assert.IsFalse(v2.HasValue); ! Assert.IsFalse(v2.Equals(12)); ! Assert.IsTrue(v2.Equals(NullableSByte.Default)); ! Assert.IsTrue(v2.Equals(DBNull.Value)); } --- 16,47 ---- [Test] ! public void BasicTestSByte() { NullableSByte v1 = 32; //should take an int literal ! Assert.IsTrue( v1.HasValue ); //should have a value; ! Assert.IsTrue( v1.Equals( 32 ) ); //implicit casting should make this result in true. ! Assert.IsTrue( v1.Value == 32 ); ! Assert.IsFalse( v1.Equals( NullableSByte.Default ) ); ! Assert.IsTrue( v1.Equals( new NullableSByte( 32 ) ) ); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue( v1 == 32 ); ! Assert.IsFalse( v1 == 33 ); ! Assert.IsFalse( v1 == NullableSByte.Default ); ! Assert.IsTrue( v1 == new NullableSByte( 32 ) ); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue( v1 == NullableSByte.Default ); v1 = NullableSByte.Default; ! Assert.IsTrue( v1 == NullableSByte.Default ); NullableSByte v2 = NullableSByte.Default; //should start as "null" ! Assert.IsFalse( v2.HasValue ); ! Assert.IsFalse( v2.Equals( 12 ) ); ! Assert.IsTrue( v2.Equals( NullableSByte.Default ) ); ! Assert.IsTrue( v2.Equals( DBNull.Value ) ); } *************** *** 56,75 **** //one null, one not x = NullableSByte.Default; ! y = new NullableSByte(16); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); //now both null x = NullableSByte.Default; y = NullableSByte.Default; ! Assert.IsTrue(x.CompareTo(y) == 0); ! Assert.IsTrue(y.CompareTo(x) == 0); //now both with a value ! x = new NullableSByte(5); ! y = new NullableSByte(43); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); } } ! } --- 54,73 ---- //one null, one not x = NullableSByte.Default; ! y = new NullableSByte( 16 ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); //now both null x = NullableSByte.Default; y = NullableSByte.Default; ! Assert.IsTrue( x.CompareTo( y ) == 0 ); ! Assert.IsTrue( y.CompareTo( x ) == 0 ); //now both with a value ! x = new NullableSByte( 5 ); ! y = new NullableSByte( 43 ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); } } ! } \ No newline at end of file Index: NullableSingleFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableSingleFixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullableSingleFixture.cs 10 Dec 2004 18:24:20 -0000 1.2 --- NullableSingleFixture.cs 16 Dec 2004 15:26:13 -0000 1.3 *************** *** 1,6 **** using System; - using Nullables; - using NUnit.Framework; --- 1,4 ---- *************** *** 18,45 **** NullableSingle v1 = 32; //should take an int literal ! Assert.IsTrue(v1.HasValue); //should have a value; ! Assert.IsTrue(v1.Equals(32)); //implicit casting should make this result in true. ! Assert.IsTrue(v1.Value == 32); ! Assert.IsFalse(v1.Equals(NullableSingle.Default)); ! Assert.IsTrue(v1.Equals(new NullableSingle(32))); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue(v1 == 32); ! Assert.IsFalse(v1 == 33); ! Assert.IsFalse(v1 == NullableSingle.Default); ! Assert.IsTrue(v1 == new NullableSingle(32)); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue(v1 == NullableSingle.Default); v1 = NullableSingle.Default; ! Assert.IsTrue(v1 == NullableSingle.Default); NullableSingle v2 = NullableSingle.Default; //should start as "null" ! Assert.IsFalse(v2.HasValue); ! Assert.IsFalse(v2.Equals(12)); ! Assert.IsTrue(v2.Equals(NullableSingle.Default)); ! Assert.IsTrue(v2.Equals(DBNull.Value)); } --- 16,43 ---- NullableSingle v1 = 32; //should take an int literal ! Assert.IsTrue( v1.HasValue ); //should have a value; ! Assert.IsTrue( v1.Equals( 32 ) ); //implicit casting should make this result in true. ! Assert.IsTrue( v1.Value == 32 ); ! Assert.IsFalse( v1.Equals( NullableSingle.Default ) ); ! Assert.IsTrue( v1.Equals( new NullableSingle( 32 ) ) ); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue( v1 == 32 ); ! Assert.IsFalse( v1 == 33 ); ! Assert.IsFalse( v1 == NullableSingle.Default ); ! Assert.IsTrue( v1 == new NullableSingle( 32 ) ); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue( v1 == NullableSingle.Default ); v1 = NullableSingle.Default; ! Assert.IsTrue( v1 == NullableSingle.Default ); NullableSingle v2 = NullableSingle.Default; //should start as "null" ! Assert.IsFalse( v2.HasValue ); ! Assert.IsFalse( v2.Equals( 12 ) ); ! Assert.IsTrue( v2.Equals( NullableSingle.Default ) ); ! Assert.IsTrue( v2.Equals( DBNull.Value ) ); } *************** *** 52,71 **** //one null, one not x = NullableSingle.Default; ! y = new NullableSingle(1.6f); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); //now both null x = NullableSingle.Default; y = NullableSingle.Default; ! Assert.IsTrue(x.CompareTo(y) == 0); ! Assert.IsTrue(y.CompareTo(x) == 0); //now both with a value ! x = new NullableSingle(5.1f); ! y = new NullableSingle(8.9f); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); } } ! } --- 50,69 ---- //one null, one not x = NullableSingle.Default; ! y = new NullableSingle( 1.6f ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); //now both null x = NullableSingle.Default; y = NullableSingle.Default; ! Assert.IsTrue( x.CompareTo( y ) == 0 ); ! Assert.IsTrue( y.CompareTo( x ) == 0 ); //now both with a value ! x = new NullableSingle( 5.1f ); ! y = new NullableSingle( 8.9f ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); } } ! } \ No newline at end of file Index: Nullables.Tests-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/Nullables.Tests-1.1.csproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Nullables.Tests-1.1.csproj 6 Dec 2004 03:17:00 -0000 1.2 --- Nullables.Tests-1.1.csproj 16 Dec 2004 15:26:13 -0000 1.3 *************** *** 172,175 **** --- 172,180 ---- /> <File + RelPath = "NullableSByteFixture.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "NullableSingleFixture.cs" SubType = "Code" Index: NullableByteFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableByteFixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullableByteFixture.cs 10 Dec 2004 18:24:20 -0000 1.2 --- NullableByteFixture.cs 16 Dec 2004 15:26:13 -0000 1.3 *************** *** 1,6 **** using System; - using Nullables; - using NUnit.Framework; --- 1,4 ---- *************** *** 18,45 **** NullableByte v1 = 32; //should take an int literal ! Assert.IsTrue(v1.HasValue); //should have a value; ! Assert.IsTrue(v1.Equals(32)); //implicit casting should make this result in true. ! Assert.IsTrue(v1.Value == 32); ! Assert.IsFalse(v1.Equals(NullableByte.Default)); ! Assert.IsTrue(v1.Equals(new NullableByte(32))); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue(v1 == 32); ! Assert.IsFalse(v1 == 33); ! Assert.IsFalse(v1 == NullableByte.Default); ! Assert.IsTrue(v1 == new NullableByte(32)); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue(v1 == NullableByte.Default); v1 = NullableByte.Default; ! Assert.IsTrue(v1 == NullableByte.Default); NullableByte v2 = NullableByte.Default; //should start as "null" ! Assert.IsFalse(v2.HasValue); ! Assert.IsFalse(v2.Equals(12)); ! Assert.IsTrue(v2.Equals(NullableByte.Default)); ! Assert.IsTrue(v2.Equals(DBNull.Value)); } --- 16,43 ---- NullableByte v1 = 32; //should take an int literal ! Assert.IsTrue( v1.HasValue ); //should have a value; ! Assert.IsTrue( v1.Equals( 32 ) ); //implicit casting should make this result in true. ! Assert.IsTrue( v1.Value == 32 ); ! Assert.IsFalse( v1.Equals( NullableByte.Default ) ); ! Assert.IsTrue( v1.Equals( new NullableByte( 32 ) ) ); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue( v1 == 32 ); ! Assert.IsFalse( v1 == 33 ); ! Assert.IsFalse( v1 == NullableByte.Default ); ! Assert.IsTrue( v1 == new NullableByte( 32 ) ); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue( v1 == NullableByte.Default ); v1 = NullableByte.Default; ! Assert.IsTrue( v1 == NullableByte.Default ); NullableByte v2 = NullableByte.Default; //should start as "null" ! Assert.IsFalse( v2.HasValue ); ! Assert.IsFalse( v2.Equals( 12 ) ); ! Assert.IsTrue( v2.Equals( NullableByte.Default ) ); ! Assert.IsTrue( v2.Equals( DBNull.Value ) ); } *************** *** 52,71 **** //one null, one not x = NullableByte.Default; ! y = new NullableByte(12); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); //now both null x = NullableByte.Default; y = NullableByte.Default; ! Assert.IsTrue(x.CompareTo(y) == 0); ! Assert.IsTrue(y.CompareTo(x) == 0); //now both with a value ! x = new NullableByte(5); ! y = new NullableByte(101); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); } } ! } --- 50,69 ---- //one null, one not x = NullableByte.Default; ! y = new NullableByte( 12 ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); //now both null x = NullableByte.Default; y = NullableByte.Default; ! Assert.IsTrue( x.CompareTo( y ) == 0 ); ! Assert.IsTrue( y.CompareTo( x ) == 0 ); //now both with a value ! x = new NullableByte( 5 ); ! y = new NullableByte( 101 ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); } } ! } \ No newline at end of file Index: NullableInt32Fixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableInt32Fixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullableInt32Fixture.cs 10 Dec 2004 18:24:20 -0000 1.2 --- NullableInt32Fixture.cs 16 Dec 2004 15:26:13 -0000 1.3 *************** *** 1,6 **** using System; - using Nullables; - using NUnit.Framework; --- 1,4 ---- *************** *** 18,46 **** NullableInt32 v1 = 32; //should take an int literal ! Assert.IsTrue(v1.HasValue); //should have a value; ! Assert.IsTrue(v1.Equals(32)); //implicit casting should make this result in true. ! Assert.IsTrue(v1.Value == 32); ! Assert.IsFalse(v1.Equals(NullableInt32.Default)); ! Assert.IsTrue(v1.Equals(new NullableInt32(32))); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue(v1 == 32); ! Assert.IsFalse(v1 == 33); ! Assert.IsFalse(v1 == NullableInt32.Default); ! Assert.IsTrue(v1 == new NullableInt32(32)); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue(v1 == NullableInt32.Default); v1 = NullableInt32.Default; ! Assert.IsTrue(v1 == NullableInt32.Default); NullableInt32 v2 = NullableInt32.Default; //should start as "null" ! Assert.IsFalse(v2.HasValue); ! Assert.IsFalse(v2.Equals(12)); ! Assert.IsTrue(v2.Equals(NullableInt32.Default)); ! Assert.IsTrue(v2.Equals(DBNull.Value)); ! Assert.IsTrue( v2==null ); } --- 16,44 ---- NullableInt32 v1 = 32; //should take an int literal ! Assert.IsTrue( v1.HasValue ); //should have a value; ! Assert.IsTrue( v1.Equals( 32 ) ); //implicit casting should make this result in true. ! Assert.IsTrue( v1.Value == 32 ); ! Assert.IsFalse( v1.Equals( NullableInt32.Default ) ); ! Assert.IsTrue( v1.Equals( new NullableInt32( 32 ) ) ); //should == a new instance with the same inner value. //same thing, but with == instead of .Equals() ! Assert.IsTrue( v1 == 32 ); ! Assert.IsFalse( v1 == 33 ); ! Assert.IsFalse( v1 == NullableInt32.Default ); ! Assert.IsTrue( v1 == new NullableInt32( 32 ) ); //now null v1. v1 = DBNull.Value; ! Assert.IsTrue( v1 == NullableInt32.Default ); v1 = NullableInt32.Default; ! Assert.IsTrue( v1 == NullableInt32.Default ); NullableInt32 v2 = NullableInt32.Default; //should start as "null" ! Assert.IsFalse( v2.HasValue ); ! Assert.IsFalse( v2.Equals( 12 ) ); ! Assert.IsTrue( v2.Equals( NullableInt32.Default ) ); ! Assert.IsTrue( v2.Equals( DBNull.Value ) ); ! Assert.IsTrue( v2 == null ); } *************** *** 53,72 **** //one null, one not x = NullableInt32.Default; ! y = new NullableInt32(16); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); //now both null x = NullableInt32.Default; y = NullableInt32.Default; ! Assert.IsTrue(x.CompareTo(y) == 0); ! Assert.IsTrue(y.CompareTo(x) == 0); //now both with a value ! x = new NullableInt32(5); ! y = new NullableInt32(43); ! Assert.IsTrue(x.CompareTo(y) < 0); ! Assert.IsTrue(y.CompareTo(x) > 0); } } ! } --- 51,70 ---- //one null, one not x = NullableInt32.Default; ! y = new NullableInt32( 16 ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); //now both null x = NullableInt32.Default; y = NullableInt32.Default; ! Assert.IsTrue( x.CompareTo( y ) == 0 ); ! Assert.IsTrue( y.CompareTo( x ) == 0 ); //now both with a value ! x = new NullableInt32( 5 ); ! y = new NullableInt32( 43 ); ! Assert.IsTrue( x.CompareTo( y ) < 0 ); ! Assert.IsTrue( y.CompareTo( x ) > 0 ); } } ! } \ No newline at end of file |