|
From: <fab...@us...> - 2009-05-15 20:55:19
|
Revision: 4320
http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4320&view=rev
Author: fabiomaulo
Date: 2009-05-15 20:55:13 +0000 (Fri, 15 May 2009)
Log Message:
-----------
Preparing test to work with different mappings
Modified Paths:
--------------
trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ElementsEnums/IntEnumsBagFixture.cs
trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj
Added Paths:
-----------
trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ElementsEnums/AbstractIntEnumsBagFixture.cs
Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ElementsEnums/AbstractIntEnumsBagFixture.cs
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ElementsEnums/AbstractIntEnumsBagFixture.cs (rev 0)
+++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ElementsEnums/AbstractIntEnumsBagFixture.cs 2009-05-15 20:55:13 UTC (rev 4320)
@@ -0,0 +1,41 @@
+using NUnit.Framework;
+using System.Collections.Generic;
+
+namespace NHibernate.Test.NHSpecificTest.ElementsEnums
+{
+ public abstract class AbstractIntEnumsBagFixture : TestCase
+ {
+ protected override string MappingsAssembly
+ {
+ get { return "NHibernate.Test"; }
+ }
+
+ [Test]
+ [Description("Should load the list of enums (NH-1772)")]
+ public void LoadEnums()
+ {
+ object savedId;
+ using (ISession s = OpenSession())
+ using (s.BeginTransaction())
+ {
+ savedId = s.Save(new SimpleWithEnums { Things = new List<Something> { Something.B, Something.C, Something.D, Something.E } });
+ s.Transaction.Commit();
+ }
+
+ using (ISession s = OpenSession())
+ using (s.BeginTransaction())
+ {
+ var swe = s.Get<SimpleWithEnums>(savedId);
+ Assert.That(swe.Things, Is.EqualTo(new[] { Something.B, Something.C, Something.D, Something.E }));
+ s.Transaction.Commit();
+ }
+
+ using (ISession s = OpenSession())
+ using (s.BeginTransaction())
+ {
+ s.Delete("from SimpleWithEnums");
+ s.Transaction.Commit();
+ }
+ }
+ }
+}
\ No newline at end of file
Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ElementsEnums/IntEnumsBagFixture.cs
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ElementsEnums/IntEnumsBagFixture.cs 2009-05-15 20:39:11 UTC (rev 4319)
+++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/ElementsEnums/IntEnumsBagFixture.cs 2009-05-15 20:55:13 UTC (rev 4320)
@@ -1,48 +1,14 @@
using System.Collections;
-using System.Collections.Generic;
using NUnit.Framework;
namespace NHibernate.Test.NHSpecificTest.ElementsEnums
{
[TestFixture]
- public class IntEnumsBagFixture : TestCase
+ public class IntEnumsBagFixture : AbstractIntEnumsBagFixture
{
protected override IList Mappings
{
get { return new[] { "NHSpecificTest.ElementsEnums.SimpleWithEnums.hbm.xml" }; }
}
-
- protected override string MappingsAssembly
- {
- get { return "NHibernate.Test"; }
- }
-
- [Test]
- [Description("Should load the list of enums (NH-1772)")]
- public void LoadEnums()
- {
- object savedId;
- using (ISession s = OpenSession())
- using (s.BeginTransaction())
- {
- savedId = s.Save(new SimpleWithEnums { Things = new List<Something> { Something.B, Something.C, Something.D, Something.E } });
- s.Transaction.Commit();
- }
-
- using (ISession s = OpenSession())
- using (s.BeginTransaction())
- {
- var swe = s.Get<SimpleWithEnums>(savedId);
- Assert.That(swe.Things, Is.EqualTo(new[] {Something.B, Something.C, Something.D, Something.E}));
- s.Transaction.Commit();
- }
-
- using (ISession s = OpenSession())
- using (s.BeginTransaction())
- {
- s.Delete("from SimpleWithEnums");
- s.Transaction.Commit();
- }
- }
}
}
\ No newline at end of file
Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-05-15 20:39:11 UTC (rev 4319)
+++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-05-15 20:55:13 UTC (rev 4320)
@@ -329,6 +329,7 @@
<Compile Include="HQL\BaseFunctionFixture.cs" />
<Compile Include="MappingTest\NonReflectiveBinderFixture.cs" />
<Compile Include="MappingTest\Wicked.cs" />
+ <Compile Include="NHSpecificTest\ElementsEnums\AbstractIntEnumsBagFixture.cs" />
<Compile Include="NHSpecificTest\ElementsEnums\IntEnumsBagFixture.cs" />
<Compile Include="NHSpecificTest\ElementsEnums\Something.cs" />
<Compile Include="NHSpecificTest\NH1264\Fixture.cs" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|