From: Peter S. <sz...@us...> - 2004-09-20 17:46:12
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/SqlCommandTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24263/SqlCommandTest Modified Files: SqlDeleteBuilderFixture.cs SqlInsertBuilderFixture.cs SqlSelectBuilderFixture.cs SqlSimpleSelectBuilderFixture.cs SqlStringParameterFixture.cs SqlUpdateBuilderFixture.cs Log Message: Removed obsolete method Assertion.*, replaced with Assert.*. Reordered asserts. Index: SqlDeleteBuilderFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/SqlCommandTest/SqlDeleteBuilderFixture.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SqlDeleteBuilderFixture.cs 19 Jul 2004 03:25:25 -0000 1.3 --- SqlDeleteBuilderFixture.cs 20 Sep 2004 17:46:01 -0000 1.4 *************** *** 40,44 **** string expectedSql = "DELETE FROM test_delete_builder WHERE decimalColumn = :decimalColumn AND versionColumn = :versionColumn AND a=b"; ! Assertion.AssertEquals("SQL String", expectedSql , sqlString.ToString()); foreach(object part in sqlString.SqlParts) { --- 40,44 ---- string expectedSql = "DELETE FROM test_delete_builder WHERE decimalColumn = :decimalColumn AND versionColumn = :versionColumn AND a=b"; ! Assert.AreEqual(expectedSql , sqlString.ToString(), "SQL String"); foreach(object part in sqlString.SqlParts) { *************** *** 48,52 **** } } ! Assertion.AssertEquals("Two parameters", 2, numOfParameters); --- 48,52 ---- } } ! Assert.AreEqual(2, numOfParameters, "Two parameters"); *************** *** 59,67 **** secondParam.Name = "versionColumn"; ! Assertion.AssertEquals("firstParam Type", firstParam.SqlType.DbType, actualParams[0].SqlType.DbType); ! Assertion.AssertEquals("firstParam Name", firstParam.Name, actualParams[0].Name); ! Assertion.AssertEquals("secondParam Type", secondParam.SqlType.DbType, actualParams[1].SqlType.DbType); ! Assertion.AssertEquals("secondParam Name", secondParam.Name, actualParams[1].Name); --- 59,67 ---- secondParam.Name = "versionColumn"; ! Assert.AreEqual(firstParam.SqlType.DbType, actualParams[0].SqlType.DbType, "firstParam Type"); ! Assert.AreEqual(firstParam.Name, actualParams[0].Name, "firstParam Name"); ! Assert.AreEqual(secondParam.SqlType.DbType, actualParams[1].SqlType.DbType, "secondParam Type"); ! Assert.AreEqual(secondParam.Name, actualParams[1].Name, "secondParam Name"); Index: SqlSimpleSelectBuilderFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/SqlCommandTest/SqlSimpleSelectBuilderFixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SqlSimpleSelectBuilderFixture.cs 19 Jul 2004 03:25:25 -0000 1.2 --- SqlSimpleSelectBuilderFixture.cs 20 Sep 2004 17:46:01 -0000 1.3 *************** *** 58,62 **** ! Assertion.AssertEquals("SQL String", expectedSql , sqlString.ToString()); foreach(object part in sqlString.SqlParts) --- 58,62 ---- ! Assert.AreEqual(expectedSql , sqlString.ToString(), "SQL String"); foreach(object part in sqlString.SqlParts) *************** *** 68,72 **** } } ! Assertion.AssertEquals("3 parameters", 3, numOfParameters); Parameter firstParam = new Parameter(); --- 68,72 ---- } } ! Assert.AreEqual(3, numOfParameters, "3 parameters"); Parameter firstParam = new Parameter(); *************** *** 82,93 **** thirdParam.Name = "where_frag_column"; ! Assertion.AssertEquals("First Parameter Type", firstParam.SqlType.DbType, actualParams[0].SqlType.DbType); ! Assertion.AssertEquals("First Parameter Name", firstParam.Name, actualParams[0].Name); ! Assertion.AssertEquals("Second Parameter Type", secondParam.SqlType.DbType, actualParams[1].SqlType.DbType); ! Assertion.AssertEquals("Second Parameter Name", secondParam.Name, actualParams[1].Name); ! Assertion.AssertEquals("Third Parameter Type", thirdParam.SqlType.DbType, actualParams[2].SqlType.DbType); ! Assertion.AssertEquals("Third Parameter Name", thirdParam.Name, actualParams[2].Name); } --- 82,93 ---- thirdParam.Name = "where_frag_column"; ! Assert.AreEqual(firstParam.SqlType.DbType, actualParams[0].SqlType.DbType, "First Parameter Type"); ! Assert.AreEqual(firstParam.Name, actualParams[0].Name, "First Parameter Name"); ! Assert.AreEqual(secondParam.SqlType.DbType, actualParams[1].SqlType.DbType, "Second Parameter Type"); ! Assert.AreEqual(secondParam.Name, actualParams[1].Name, "Second Parameter Name"); ! Assert.AreEqual(thirdParam.SqlType.DbType, actualParams[2].SqlType.DbType, "Third Parameter Type"); ! Assert.AreEqual(thirdParam.Name, actualParams[2].Name, "Third Parameter Name"); } Index: SqlUpdateBuilderFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/SqlCommandTest/SqlUpdateBuilderFixture.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SqlUpdateBuilderFixture.cs 19 Jul 2004 03:25:25 -0000 1.3 --- SqlUpdateBuilderFixture.cs 20 Sep 2004 17:46:01 -0000 1.4 *************** *** 45,49 **** string expectedSql = "UPDATE test_update_builder SET intColumn = :intColumn, longColumn = :longColumn, literalColumn = 0, stringColumn = 5 WHERE decimalColumn = :decimalColumn AND versionColumn = :versionColumn AND a=b"; ! Assertion.AssertEquals("SQL String", expectedSql , sqlString.ToString()); foreach(object part in sqlString.SqlParts) --- 45,49 ---- string expectedSql = "UPDATE test_update_builder SET intColumn = :intColumn, longColumn = :longColumn, literalColumn = 0, stringColumn = 5 WHERE decimalColumn = :decimalColumn AND versionColumn = :versionColumn AND a=b"; ! Assert.AreEqual(expectedSql , sqlString.ToString(), "SQL String"); foreach(object part in sqlString.SqlParts) *************** *** 55,59 **** } } ! Assertion.AssertEquals("Four parameters", 4, numOfParameters); --- 55,59 ---- } } ! Assert.AreEqual(4, numOfParameters, "Four parameters"); *************** *** 74,88 **** fourthParam.Name = "versionColumn"; ! Assertion.AssertEquals("firstParam Type", firstParam.SqlType.DbType, actualParams[0].SqlType.DbType); ! Assertion.AssertEquals("firstParam Name", firstParam.Name, actualParams[0].Name); ! Assertion.AssertEquals("secondParam Type", secondParam.SqlType.DbType, actualParams[1].SqlType.DbType); ! Assertion.AssertEquals("secondParam Name", secondParam.Name, actualParams[1].Name); ! Assertion.AssertEquals("thirdParam Type", thirdParam.SqlType.DbType, actualParams[2].SqlType.DbType); ! Assertion.AssertEquals("thirdParam Name", thirdParam.Name, actualParams[2].Name); ! Assertion.AssertEquals("fourthParam Type", fourthParam.SqlType.DbType, actualParams[3].SqlType.DbType); ! Assertion.AssertEquals("fourthParam Name", fourthParam.Name, actualParams[3].Name); --- 74,88 ---- fourthParam.Name = "versionColumn"; ! Assert.AreEqual(firstParam.SqlType.DbType, actualParams[0].SqlType.DbType, "firstParam Type"); ! Assert.AreEqual(firstParam.Name, actualParams[0].Name, "firstParam Name"); ! Assert.AreEqual(secondParam.SqlType.DbType, actualParams[1].SqlType.DbType, "secondParam Type"); ! Assert.AreEqual(secondParam.Name, actualParams[1].Name, "secondParam Name"); ! Assert.AreEqual(thirdParam.SqlType.DbType, actualParams[2].SqlType.DbType, "thirdParam Type"); ! Assert.AreEqual(thirdParam.Name, actualParams[2].Name, "thirdParam Name"); ! Assert.AreEqual(fourthParam.SqlType.DbType, actualParams[3].SqlType.DbType, "fourthParam Type"); ! Assert.AreEqual(fourthParam.Name, actualParams[3].Name, "fourthParam Name"); Index: SqlStringParameterFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/SqlCommandTest/SqlStringParameterFixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SqlStringParameterFixture.cs 19 Jul 2004 03:25:25 -0000 1.2 --- SqlStringParameterFixture.cs 20 Sep 2004 17:46:01 -0000 1.3 *************** *** 28,34 **** cloned = (Parameter)original.Clone(); ! Assertion.Assert("Not the same object by ==", (original==cloned)==false); ! Assertion.AssertEquals("Same DbType", original.SqlType.DbType, cloned.SqlType.DbType); ! Assertion.AssertEquals("Same Name", original.Name, cloned.Name); // change some of the values of the clone to ensure the original doesn't change --- 28,34 ---- cloned = (Parameter)original.Clone(); ! Assert.IsTrue((original==cloned)==false, "Not the same object by =="); ! Assert.AreEqual(original.SqlType.DbType, cloned.SqlType.DbType, "Same DbType"); ! Assert.AreEqual(original.Name, cloned.Name, "Same Name"); // change some of the values of the clone to ensure the original doesn't change *************** *** 37,42 **** cloned.Name = "Cloned name"; ! Assertion.Assert("Should not the same db type anymore", cloned.SqlType.DbType!=original.SqlType.DbType); ! Assertion.Assert("Should not the same name anymore", cloned.Name!=original.Name); --- 37,42 ---- cloned.Name = "Cloned name"; ! Assert.IsTrue(cloned.SqlType.DbType!=original.SqlType.DbType, "Should not the same db type anymore"); ! Assert.IsTrue(cloned.Name!=original.Name, "Should not the same name anymore"); *************** *** 55,62 **** cloned = (ParameterLength)original.Clone(); ! Assertion.Assert("Not the same object by ==", (original==cloned)==false); ! Assertion.AssertEquals("Same DbType", original.SqlType.DbType, cloned.SqlType.DbType); ! Assertion.AssertEquals("Same Name", original.Name, cloned.Name); ! Assertion.AssertEquals("Same Length", original.Length, cloned.Length); // change some of the values of the clone to ensure the original doesn't change --- 55,62 ---- cloned = (ParameterLength)original.Clone(); ! Assert.IsTrue((original==cloned)==false, "Not the same object by =="); ! Assert.AreEqual(original.SqlType.DbType, cloned.SqlType.DbType, "Same DbType"); ! Assert.AreEqual(original.Name, cloned.Name, "Same Name"); ! Assert.AreEqual(original.Length, cloned.Length, "Same Length"); // change some of the values of the clone to ensure the original doesn't change *************** *** 66,72 **** cloned.Length = 175; ! Assertion.Assert("Should not the same db type anymore", cloned.SqlType.DbType!=original.SqlType.DbType); ! Assertion.Assert("Should not the same name anymore", cloned.Name!=original.Name); ! Assertion.Assert("Should not the same length anymore", cloned.Length!=original.Length); } --- 66,72 ---- cloned.Length = 175; ! Assert.IsTrue(cloned.SqlType.DbType!=original.SqlType.DbType, "Should not the same db type anymore"); ! Assert.IsTrue(cloned.Name!=original.Name, "Should not the same name anymore"); ! Assert.IsTrue(cloned.Length!=original.Length, "Should not the same length anymore"); } *************** *** 85,93 **** cloned = (ParameterPrecisionScale)original.Clone(); ! Assertion.Assert("Not the same object by ==", (original==cloned)==false); ! Assertion.AssertEquals("Same DbType", original.SqlType.DbType, cloned.SqlType.DbType); ! Assertion.AssertEquals("Same Name", original.Name, cloned.Name); ! Assertion.AssertEquals("Same Precision", original.Precision, cloned.Precision); ! Assertion.AssertEquals("Same Scale", original.Scale, cloned.Scale); // change some of the values of the clone to ensure the original doesn't change --- 85,93 ---- cloned = (ParameterPrecisionScale)original.Clone(); ! Assert.IsTrue((original==cloned)==false, "Not the same object by =="); ! Assert.AreEqual(original.SqlType.DbType, cloned.SqlType.DbType, "Same DbType"); ! Assert.AreEqual(original.Name, cloned.Name, "Same Name"); ! Assert.AreEqual(original.Precision, cloned.Precision, "Same Precision"); ! Assert.AreEqual(original.Scale, cloned.Scale, "Same Scale"); // change some of the values of the clone to ensure the original doesn't change *************** *** 100,107 **** cloned.Scale = 4; ! Assertion.Assert("Should not the same db type anymore", cloned.SqlType.DbType!=original.SqlType.DbType); ! Assertion.Assert("Should not the same name anymore", cloned.Name!=original.Name); ! Assertion.Assert("Should not the same Precision anymore", cloned.Precision!=original.Precision); ! Assertion.Assert("Should not the same Scale anymore", cloned.Scale!=original.Scale); } --- 100,107 ---- cloned.Scale = 4; ! Assert.IsTrue(cloned.SqlType.DbType!=original.SqlType.DbType, "Should not the same db type anymore"); ! Assert.IsTrue(cloned.Name!=original.Name, "Should not the same name anymore"); ! Assert.IsTrue(cloned.Precision!=original.Precision, "Should not the same Precision anymore"); ! Assert.IsTrue(cloned.Scale!=original.Scale, "Should not the same Scale anymore"); } *************** *** 136,145 **** cloned = original.Clone(); ! Assertion.Assert("Not the same SqlString by ==", (original==cloned)==false); ! Assertion.AssertEquals("Same # of parts", original.SqlParts.Length, cloned.SqlParts.Length); ! Assertion.Assert("First param not the same by ==", (original.SqlParts[1]==cloned.SqlParts[1])==false); ! Assertion.Assert("Second param not the same by ==", (original.SqlParts[3]==cloned.SqlParts[3])==false); ! Assertion.AssertEquals("The ToString() is the same", original.ToString(), cloned.ToString()); // modify the first parameter of the clone to ensure they are not the same --- 136,145 ---- cloned = original.Clone(); ! Assert.IsTrue((original==cloned)==false, "Not the same SqlString by =="); ! Assert.AreEqual(original.SqlParts.Length, cloned.SqlParts.Length, "Same # of parts"); ! Assert.IsTrue((original.SqlParts[1]==cloned.SqlParts[1])==false, "First param not the same by =="); ! Assert.IsTrue((original.SqlParts[3]==cloned.SqlParts[3])==false, "Second param not the same by =="); ! Assert.AreEqual(original.ToString(), cloned.ToString(), "The ToString() is the same"); // modify the first parameter of the clone to ensure they are not the same *************** *** 148,152 **** lastParamPart.Name = "modifiedOP2"; ! Assertion.Assert("Should not be the same ToString()", cloned.ToString()!=original.ToString()); } --- 148,152 ---- lastParamPart.Name = "modifiedOP2"; ! Assert.IsTrue(cloned.ToString()!=original.ToString(), "Should not be the same ToString()"); } Index: SqlSelectBuilderFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/SqlCommandTest/SqlSelectBuilderFixture.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SqlSelectBuilderFixture.cs 19 Aug 2004 17:44:12 -0000 1.3 --- SqlSelectBuilderFixture.cs 20 Sep 2004 17:46:01 -0000 1.4 *************** *** 62,67 **** } ! Assertion.AssertEquals("SQL String", expectedSql , sqlString.ToString()); ! Assertion.AssertEquals("One parameter", 1, numOfParams); Parameter firstParam = new Parameter(); --- 62,67 ---- } ! Assert.AreEqual(expectedSql , sqlString.ToString(), "SQL String"); ! Assert.AreEqual(1, numOfParams, "One parameter"); Parameter firstParam = new Parameter(); *************** *** 70,76 **** firstParam.Name = "identity_column"; ! Assertion.AssertEquals("First Parameter Type", firstParam.SqlType.DbType, expectedParam.SqlType.DbType); ! Assertion.AssertEquals("First Parameter TableAlias", firstParam.TableAlias, expectedParam.TableAlias); ! Assertion.AssertEquals("First Parameter Name", firstParam.Name, expectedParam.Name); --- 70,76 ---- firstParam.Name = "identity_column"; ! Assert.AreEqual(firstParam.SqlType.DbType, expectedParam.SqlType.DbType, "First Parameter Type"); ! Assert.AreEqual(firstParam.TableAlias, expectedParam.TableAlias, "First Parameter TableAlias"); ! Assert.AreEqual(firstParam.Name, expectedParam.Name, "First Parameter Name"); Index: SqlInsertBuilderFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/SqlCommandTest/SqlInsertBuilderFixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SqlInsertBuilderFixture.cs 19 Jul 2004 03:25:25 -0000 1.2 --- SqlInsertBuilderFixture.cs 20 Sep 2004 17:46:01 -0000 1.3 *************** *** 39,43 **** string expectedSql = "INSERT INTO test_insert_builder (intColumn, longColumn, literalColumn, stringColumn) VALUES (:intColumn, :longColumn, 0, 5)"; ! Assertion.AssertEquals("SQL String", expectedSql , sqlString.ToString()); foreach(object part in sqlString.SqlParts) --- 39,43 ---- string expectedSql = "INSERT INTO test_insert_builder (intColumn, longColumn, literalColumn, stringColumn) VALUES (:intColumn, :longColumn, 0, 5)"; ! Assert.AreEqual(expectedSql , sqlString.ToString(), "SQL String"); foreach(object part in sqlString.SqlParts) *************** *** 50,54 **** } ! Assertion.AssertEquals("Two parameters", 2, numOfParameters); Parameter firstParam = new Parameter(); --- 50,54 ---- } ! Assert.AreEqual(2, numOfParameters, "Two parameters"); Parameter firstParam = new Parameter(); *************** *** 60,68 **** secondParam.Name = "longColumn"; ! Assertion.AssertEquals("First Parameter Type", firstParam.SqlType.DbType, actualParams[0].SqlType.DbType); ! Assertion.AssertEquals("First Parameter Name", firstParam.Name, actualParams[0].Name); ! Assertion.AssertEquals("Second Parameter Type", secondParam.SqlType.DbType, actualParams[1].SqlType.DbType); ! Assertion.AssertEquals("Second Parameter Name", secondParam.Name, actualParams[1].Name); --- 60,68 ---- secondParam.Name = "longColumn"; ! Assert.AreEqual(firstParam.SqlType.DbType, actualParams[0].SqlType.DbType, "First Parameter Type"); ! Assert.AreEqual(firstParam.Name, actualParams[0].Name, "First Parameter Name"); ! Assert.AreEqual(secondParam.SqlType.DbType, actualParams[1].SqlType.DbType, "Second Parameter Type"); ! Assert.AreEqual(secondParam.Name, actualParams[1].Name, "Second Parameter Name"); |