Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/QueryTest
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6714/src/NHibernate.Test/QueryTest
Modified Files:
NamedParametersFixture.cs PositionalParametersFixture.cs
Log Message:
Major TestCase refactoring:
- schema is now always set up in TestCase.TestFixtureSetUp and dropped in TestCase.TestFixtureTearDown
- added property Mappings and MappingsAssembly to specify mappings declaratively instead of manually calling SchemaExport
! all tests now have to clean up the database after themselves! This is checked in TestCase.TearDown.
- test cases not cleaning up the database were fixed
- SetUp and TearDown are non-virtual, test writers are supposed to override OnSetUp and OnTearDown instead.
- Added TypeFixtureBase for type-related fixtures to reduce code duplication somewhat
These modifications sped up tests 10 times on my machine.
Index: PositionalParametersFixture.cs
===================================================================
RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/QueryTest/PositionalParametersFixture.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** PositionalParametersFixture.cs 6 May 2005 16:01:56 -0000 1.3
--- PositionalParametersFixture.cs 6 May 2005 23:41:19 -0000 1.4
***************
*** 11,43 ****
public class PositionalParametersFixture : TestCase
{
! #region NUnit.Framework.TestFixture Members
!
! [TestFixtureSetUp]
! public void TestFixtureSetUp()
! {
! ExportSchema( new string[] { "Simple.hbm.xml"} );
! }
!
! [SetUp]
! public void SetUp()
! {
! // there are test in here where we don't need to resetup the
! // tables - so only set the tables up once
! }
!
! [TearDown]
! public override void TearDown()
! {
! // do nothing except not let the base TearDown get called
! }
!
! [TestFixtureTearDown]
! public void TestFixtureTearDown()
{
! base.TearDown();
}
- #endregion
-
[Test, ExpectedException(typeof(NHibernate.QueryException))]
public void TestMissingHQLParameters()
--- 11,22 ----
public class PositionalParametersFixture : TestCase
{
! protected override IList Mappings
{
! get
! {
! return new string[] { "Simple.hbm.xml" };
! }
}
[Test, ExpectedException(typeof(NHibernate.QueryException))]
public void TestMissingHQLParameters()
Index: NamedParametersFixture.cs
===================================================================
RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/QueryTest/NamedParametersFixture.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** NamedParametersFixture.cs 6 May 2005 16:01:55 -0000 1.3
--- NamedParametersFixture.cs 6 May 2005 23:41:19 -0000 1.4
***************
*** 12,44 ****
public class NamedParametersFixture : TestCase
{
! #region NUnit.Framework.TestFixture Members
!
! [TestFixtureSetUp]
! public void TestFixtureSetUp()
! {
! ExportSchema( new string[] { "Simple.hbm.xml"} );
! }
!
! [SetUp]
! public void SetUp()
! {
! // there are test in here where we don't need to resetup the
! // tables - so only set the tables up once
! }
!
! [TearDown]
! public override void TearDown()
! {
! // do nothing except not let the base TearDown get called
! }
!
! [TestFixtureTearDown]
! public void TestFixtureTearDown()
{
! base.TearDown();
}
- #endregion
-
[Test, ExpectedException(typeof(NHibernate.QueryException))]
public void TestMissingHQLParameters()
--- 12,23 ----
public class NamedParametersFixture : TestCase
{
! protected override IList Mappings
{
! get
! {
! return new string[] { "Simple.hbm.xml"};
! }
}
[Test, ExpectedException(typeof(NHibernate.QueryException))]
public void TestMissingHQLParameters()
|