From: Peter S. <sz...@us...> - 2004-09-20 17:46:12
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24263/NHSpecificTest Modified Files: BasicBinaryFixture.cs BasicClassFixture.cs ClassWithCompositeIdFixture.cs JoinedSubclassFixture.cs MapFixture.cs SimpleComponentFixture.cs SubclassFixture.cs UnsavedValueFixture.cs Log Message: Removed obsolete method Assertion.*, replaced with Assert.*. Reordered asserts. Index: BasicClassFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest/BasicClassFixture.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** BasicClassFixture.cs 1 Sep 2004 00:10:28 -0000 1.5 --- BasicClassFixture.cs 20 Sep 2004 17:46:00 -0000 1.6 *************** *** 41,45 **** bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); ! Assertion.AssertNotNull(bc[index]); AssertPropertiesEqual(bc[index-1], bc[index]); --- 41,45 ---- bc[index] = (BasicClass)s[index].Load(typeof(BasicClass), id); ! Assert.IsNotNull(bc[index]); AssertPropertiesEqual(bc[index-1], bc[index]); *************** *** 768,772 **** .List(); ! Assertion.AssertEquals(0, results.Count); s.Close(); --- 768,772 ---- .List(); ! Assert.AreEqual(0, results.Count); s.Close(); *************** *** 819,823 **** Assert.AreEqual(expected.DateTimeProperty, actual.DateTimeProperty, "DateTimeProperty"); Assert.AreEqual(expected.DecimalProperty, actual.DecimalProperty, "DecimalProperty using Assert should be AreEqual"); ! Assertion.Assert("DecimalProperty", expected.DecimalProperty.Equals(actual.DecimalProperty)); // Assert.AreEqual(expected.DoubleProperty, actual.DoubleProperty, 0, "DoubleProperty"); Assert.AreEqual(expected.Int16Property, actual.Int16Property, "Int16Property"); --- 819,823 ---- Assert.AreEqual(expected.DateTimeProperty, actual.DateTimeProperty, "DateTimeProperty"); Assert.AreEqual(expected.DecimalProperty, actual.DecimalProperty, "DecimalProperty using Assert should be AreEqual"); ! Assert.IsTrue(expected.DecimalProperty.Equals(actual.DecimalProperty), "DecimalProperty"); // Assert.AreEqual(expected.DoubleProperty, actual.DoubleProperty, 0, "DoubleProperty"); Assert.AreEqual(expected.Int16Property, actual.Int16Property, "Int16Property"); *************** *** 832,841 **** if(includeCollections) { ! ObjectAssertion.AssertEquals(expected.StringArray, actual.StringArray); ! ObjectAssertion.AssertEquals(expected.Int32Array, actual.Int32Array); ! ObjectAssertion.AssertEquals(expected.StringBag, actual.StringBag, false); ! ObjectAssertion.AssertEquals(expected.StringList, actual.StringList); ! ObjectAssertion.AssertEquals(expected.StringMap, actual.StringMap, true); ! ObjectAssertion.AssertEquals(expected.StringSet, actual.StringSet, false); } } --- 832,841 ---- if(includeCollections) { ! ObjectAssert.AssertEquals(expected.StringArray, actual.StringArray); ! ObjectAssert.AssertEquals(expected.Int32Array, actual.Int32Array); ! ObjectAssert.AssertEquals(expected.StringBag, actual.StringBag, false); ! ObjectAssert.AssertEquals(expected.StringList, actual.StringList); ! ObjectAssert.AssertEquals(expected.StringMap, actual.StringMap, true); ! ObjectAssert.AssertEquals(expected.StringSet, actual.StringSet, false); } } Index: SubclassFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest/SubclassFixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SubclassFixture.cs 23 Aug 2004 13:13:25 -0000 1.2 --- SubclassFixture.cs 20 Sep 2004 17:46:00 -0000 1.3 *************** *** 56,65 **** // do some quick checks to make sure s2 loaded an object with the same data as s2 saved. ! ObjectAssertion.AssertPropertiesEqual(base1, base2); // the object with id=2 was loaded using the base class - lets make sure it actually loaded // the sublcass JoinedSubclassOne one2 = oneBase2 as JoinedSubclassOne; ! Assertion.AssertNotNull(one2); // lets update the objects --- 56,65 ---- // do some quick checks to make sure s2 loaded an object with the same data as s2 saved. ! ObjectAssert.AssertPropertiesEqual(base1, base2); // the object with id=2 was loaded using the base class - lets make sure it actually loaded // the sublcass JoinedSubclassOne one2 = oneBase2 as JoinedSubclassOne; ! Assert.IsNotNull(one2); // lets update the objects *************** *** 86,90 **** .List(); ! Assertion.AssertEquals(2, results3.Count); JoinedSubclassBase base3 = null; --- 86,90 ---- .List(); ! Assert.AreEqual(2, results3.Count); JoinedSubclassBase base3 = null; *************** *** 100,105 **** // verify the properties got updated ! ObjectAssertion.AssertPropertiesEqual(base2, base3); ! ObjectAssertion.AssertPropertiesEqual(one2, one3); s3.Delete(base3); --- 100,105 ---- // verify the properties got updated ! ObjectAssert.AssertPropertiesEqual(base2, base3); ! ObjectAssert.AssertPropertiesEqual(one2, one3); s3.Delete(base3); Index: SimpleComponentFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest/SimpleComponentFixture.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SimpleComponentFixture.cs 9 Jun 2004 01:06:22 -0000 1.1 --- SimpleComponentFixture.cs 20 Sep 2004 17:46:00 -0000 1.2 *************** *** 29,35 **** SimpleComponent simpleComp = (SimpleComponent)s.Load(typeof(SimpleComponent), 10); ! Assertion.AssertEquals(10, simpleComp.Key); ! Assertion.AssertEquals("TestCreated", simpleComp.Audit.CreatedUserId); ! Assertion.AssertEquals("TestUpdated", simpleComp.Audit.UpdatedUserId); t.Commit(); --- 29,35 ---- SimpleComponent simpleComp = (SimpleComponent)s.Load(typeof(SimpleComponent), 10); ! Assert.AreEqual(10, simpleComp.Key); ! Assert.AreEqual("TestCreated", simpleComp.Audit.CreatedUserId); ! Assert.AreEqual("TestUpdated", simpleComp.Audit.UpdatedUserId); t.Commit(); Index: JoinedSubclassFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest/JoinedSubclassFixture.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JoinedSubclassFixture.cs 9 Jun 2004 01:06:22 -0000 1.1 --- JoinedSubclassFixture.cs 20 Sep 2004 17:46:00 -0000 1.2 *************** *** 67,76 **** // do some quick checks to make sure s2 loaded an object with the same data as s2 saved. ! ObjectAssertion.AssertPropertiesEqual(base1, base2); // the object with id=2 was loaded using the base class - lets make sure it actually loaded // the sublcass JoinedSubclassOne one2 = oneBase2 as JoinedSubclassOne; ! Assertion.AssertNotNull(one2); // lets update the objects --- 67,76 ---- // do some quick checks to make sure s2 loaded an object with the same data as s2 saved. ! ObjectAssert.AssertPropertiesEqual(base1, base2); // the object with id=2 was loaded using the base class - lets make sure it actually loaded // the sublcass JoinedSubclassOne one2 = oneBase2 as JoinedSubclassOne; ! Assert.IsNotNull(one2); // lets update the objects *************** *** 97,101 **** .List(); ! Assertion.AssertEquals(2, results3.Count); JoinedSubclassBase base3 = null; --- 97,101 ---- .List(); ! Assert.AreEqual(2, results3.Count); JoinedSubclassBase base3 = null; *************** *** 111,116 **** // verify the properties got updated ! ObjectAssertion.AssertPropertiesEqual(base2, base3); ! ObjectAssertion.AssertPropertiesEqual(one2, one3); s3.Delete(base3); --- 111,116 ---- // verify the properties got updated ! ObjectAssert.AssertPropertiesEqual(base2, base3); ! ObjectAssert.AssertPropertiesEqual(one2, one3); s3.Delete(base3); Index: BasicBinaryFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest/BasicBinaryFixture.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** BasicBinaryFixture.cs 31 Aug 2004 21:24:38 -0000 1.4 --- BasicBinaryFixture.cs 20 Sep 2004 17:46:00 -0000 1.5 *************** *** 93,98 **** Assert.IsFalse(bcBinary==bcBinaryLoaded); ! ObjectAssertion.AssertEquals(bcBinary.DefaultSize, bcBinaryLoaded.DefaultSize); ! ObjectAssertion.AssertEquals(bcBinary.WithSize, bcBinaryLoaded.WithSize); s.Delete(bcBinaryLoaded); --- 93,98 ---- Assert.IsFalse(bcBinary==bcBinaryLoaded); ! ObjectAssert.AssertEquals(bcBinary.DefaultSize, bcBinaryLoaded.DefaultSize); ! ObjectAssert.AssertEquals(bcBinary.WithSize, bcBinaryLoaded.WithSize); s.Delete(bcBinaryLoaded); *************** *** 128,132 **** Assert.AreEqual( 126, bcBinary.DefaultSize[1] ); // WithSize should not have been updated ! ObjectAssertion.AssertEquals( bcBinary.WithSize, GetByteArray(10) ); // lets modify WithSize --- 128,132 ---- Assert.AreEqual( 126, bcBinary.DefaultSize[1] ); // WithSize should not have been updated ! ObjectAssert.AssertEquals( bcBinary.WithSize, GetByteArray(10) ); // lets modify WithSize *************** *** 142,146 **** Assert.AreEqual( 126, bcBinary.DefaultSize[1] ); ! ObjectAssertion.AssertEquals( bcBinary.WithSize, GetByteArray(20) ); s.Delete(bcBinary); --- 142,146 ---- Assert.AreEqual( 126, bcBinary.DefaultSize[1] ); ! ObjectAssert.AssertEquals( bcBinary.WithSize, GetByteArray(20) ); s.Delete(bcBinary); Index: UnsavedValueFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest/UnsavedValueFixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** UnsavedValueFixture.cs 16 Aug 2004 05:15:10 -0000 1.2 --- UnsavedValueFixture.cs 20 Sep 2004 17:46:00 -0000 1.3 *************** *** 36,40 **** // simple should have been inserted - generating a new key for it ! Assertion.Assert("Id should not be zero", unsavedToSave.Id != 0); // use the ICriteria interface to get another instance in a different --- 36,40 ---- // simple should have been inserted - generating a new key for it ! Assert.IsTrue(unsavedToSave.Id != 0, "Id should not be zero"); // use the ICriteria interface to get another instance in a different *************** *** 47,56 **** .List(); ! Assertion.AssertEquals("Should have found a match for the new Id", 1, results2.Count); UnsavedType unsavedToUpdate = (UnsavedType)results2[0]; // make sure it has the same Id ! Assertion.AssertEquals("Should have the same Id", unsavedToSave.Id, unsavedToUpdate.Id); t2.Commit(); --- 47,56 ---- .List(); ! Assert.AreEqual(1, results2.Count, "Should have found a match for the new Id"); UnsavedType unsavedToUpdate = (UnsavedType)results2[0]; // make sure it has the same Id ! Assert.AreEqual(unsavedToSave.Id, unsavedToUpdate.Id, "Should have the same Id"); t2.Commit(); *************** *** 71,75 **** // make sure it has the same Id - if the Id has changed then that means it // was inserted. ! Assertion.AssertEquals("Should have the same Id", unsavedToSave.Id, unsavedToUpdate.Id); // lets get a list of all the rows in the table to make sure --- 71,75 ---- // make sure it has the same Id - if the Id has changed then that means it // was inserted. ! Assert.AreEqual(unsavedToSave.Id, unsavedToUpdate.Id, "Should have the same Id"); // lets get a list of all the rows in the table to make sure *************** *** 79,87 **** IList results4 = s4.CreateCriteria(typeof(UnsavedType)).List(); ! Assertion.AssertEquals("Should only be one item", 1, results4.Count); // lets make sure the object was updated UnsavedType unsavedToDelete = (UnsavedType)results4[0]; ! Assertion.AssertEquals(unsavedToUpdate.TypeName, unsavedToDelete.TypeName); s4.Delete(unsavedToDelete); --- 79,87 ---- IList results4 = s4.CreateCriteria(typeof(UnsavedType)).List(); ! Assert.AreEqual(1, results4.Count, "Should only be one item"); // lets make sure the object was updated UnsavedType unsavedToDelete = (UnsavedType)results4[0]; ! Assert.AreEqual(unsavedToUpdate.TypeName, unsavedToDelete.TypeName); s4.Delete(unsavedToDelete); *************** *** 96,100 **** { UnsavedType unsavedNull = (UnsavedType)s5.Load(typeof(UnsavedType), unsavedToDelete.Id); ! Assertion.AssertNull(unsavedNull); } catch(ObjectNotFoundException onfe) --- 96,100 ---- { UnsavedType unsavedNull = (UnsavedType)s5.Load(typeof(UnsavedType), unsavedToDelete.Id); ! Assert.IsNull(unsavedNull); } catch(ObjectNotFoundException onfe) Index: ClassWithCompositeIdFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest/ClassWithCompositeIdFixture.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ClassWithCompositeIdFixture.cs 16 Aug 2004 05:15:10 -0000 1.4 --- ClassWithCompositeIdFixture.cs 20 Sep 2004 17:46:00 -0000 1.5 *************** *** 87,91 **** .List(); ! Assertion.AssertEquals(1, results2.Count); ClassWithCompositeId theSecondClass2 = (ClassWithCompositeId)results2[0]; --- 87,91 ---- .List(); ! Assert.AreEqual(1, results2.Count); ClassWithCompositeId theSecondClass2 = (ClassWithCompositeId)results2[0]; *************** *** 93,104 **** // verify the same results through Criteria & Load were achieved ! Assertion.AssertSame(theClass2, theClass2Copy); // compare them to the objects created in the first session ! Assertion.AssertEquals(theClass.Id, theClass2.Id); ! Assertion.AssertEquals(theClass.OneProperty, theClass2.OneProperty); ! Assertion.AssertEquals(theSecondClass.Id, theSecondClass2.Id); ! Assertion.AssertEquals(theSecondClass.OneProperty, theSecondClass2.OneProperty); // test the update functionallity --- 93,104 ---- // verify the same results through Criteria & Load were achieved ! Assert.AreSame(theClass2, theClass2Copy); // compare them to the objects created in the first session ! Assert.AreEqual(theClass.Id, theClass2.Id); ! Assert.AreEqual(theClass.OneProperty, theClass2.OneProperty); ! Assert.AreEqual(theSecondClass.Id, theSecondClass2.Id); ! Assert.AreEqual(theSecondClass.OneProperty, theSecondClass2.OneProperty); // test the update functionallity *************** *** 120,125 **** // check the update properties ! Assertion.AssertEquals(theClass3.OneProperty, theClass2.OneProperty); ! Assertion.AssertEquals(theSecondClass3.OneProperty, theSecondClass2.OneProperty); // test the delete method --- 120,125 ---- // check the update properties ! Assert.AreEqual(theClass3.OneProperty, theClass2.OneProperty); ! Assert.AreEqual(theSecondClass3.OneProperty, theSecondClass2.OneProperty); // test the delete method *************** *** 147,151 **** .List(); ! Assertion.AssertEquals(0, results.Count); } --- 147,151 ---- .List(); ! Assert.AreEqual(0, results.Count); } Index: MapFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest/MapFixture.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MapFixture.cs 9 Jun 2004 01:06:22 -0000 1.1 --- MapFixture.cs 20 Sep 2004 17:46:00 -0000 1.2 *************** *** 93,97 **** currentId = friend.Id; ! Assertion.Assert("Current should have a higher Id than previous", currentId > previousId); } --- 93,97 ---- currentId = friend.Id; ! Assert.IsTrue(currentId > previousId, "Current should have a higher Id than previous"); } |