[tarantino] r155 committed - - Broke dependency between Tarantino.Infrastructure and SMO, NUnit, an...

0 views
Skip to first unread message

codesite...@google.com

unread,
Dec 29, 2009, 4:19:06 PM12/29/09
to tarantino...@googlegroups.com
Revision: 155
Author: kwhurwitz
Date: Tue Dec 29 13:18:46 2009
Log: - Broke dependency between Tarantino.Infrastructure and SMO, NUnit,
and NAnt
http://code.google.com/p/tarantino/source/detail?r=155

Modified:

/trunk/src/Tarantino.Infrastructure/Commons/DataAccess/Repositories/RepositoryBase.cs
/trunk/src/Tarantino.Infrastructure/Tarantino.Infrastructure.csproj
/trunk/src/Tarantino.IntegrationTests/DatabaseTesterBase.cs

=======================================
---
/trunk/src/Tarantino.Infrastructure/Commons/DataAccess/Repositories/RepositoryBase.cs
Thu Aug 21 07:59:45 2008
+++
/trunk/src/Tarantino.Infrastructure/Commons/DataAccess/Repositories/RepositoryBase.cs
Tue Dec 29 13:18:46 2009
@@ -1,8 +1,4 @@
-using System.Reflection;
using NHibernate;
-using NUnit.Framework;
-using NUnit.Framework.SyntaxHelpers;
-using Tarantino.Core.Commons.Model;
using Tarantino.Infrastructure.Commons.DataAccess.ORMapper;

namespace Tarantino.Infrastructure.Commons.DataAccess.Repositories
@@ -23,36 +19,5 @@
var session = ConfigurationFile == null ?
_sessionBuilder.GetSession() :
_sessionBuilder.GetSession(ConfigurationFile);
return session;
}
-
- protected void AssertObjectCanBePersisted<T>(T persistentObject) where
T : PersistentObject
- {
- using (ISession session = GetSession())
- {
- session.SaveOrUpdate(persistentObject);
- session.Flush();
- }
-
- using (ISession session = GetSession())
- {
- var reloadedObject = session.Load<T>(persistentObject.Id);
- Assert.That(reloadedObject, Is.EqualTo(persistentObject));
- Assert.That(reloadedObject, Is.Not.SameAs(persistentObject));
- AssertObjectsMatch(persistentObject, reloadedObject);
- }
- }
-
- protected static void AssertObjectsMatch(object obj1, object obj2)
- {
- Assert.AreNotSame(obj1, obj2);
- Assert.AreEqual(obj1, obj2);
-
- var infos = obj1.GetType().GetProperties(BindingFlags.Instance |
BindingFlags.Public);
- foreach (var info in infos)
- {
- var value1 = info.GetValue(obj1, null);
- var value2 = info.GetValue(obj2, null);
- Assert.AreEqual(value1, value2, string.Format("Property {0} doesn't
match", info.Name));
- }
- }
}
}
=======================================
--- /trunk/src/Tarantino.Infrastructure/Tarantino.Infrastructure.csproj Tue
Dec 29 12:09:43 2009
+++ /trunk/src/Tarantino.Infrastructure/Tarantino.Infrastructure.csproj Tue
Dec 29 13:18:46 2009
@@ -38,32 +38,10 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\NHibernate\1.2.1\log4net.dll</HintPath>
</Reference>
- <Reference Include="Microsoft.SqlServer.ConnectionInfo,
Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91,
processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
-
<HintPath>..\..\lib\SqlServer\Microsoft.SqlServer.ConnectionInfo.dll</HintPath>
- <Private>True</Private>
- </Reference>
- <Reference Include="Microsoft.SqlServer.Management.Sdk.Sfc,
Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91,
processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
-
<HintPath>..\..\lib\SqlServer\Microsoft.SqlServer.Management.Sdk.Sfc.dll</HintPath>
- </Reference>
- <Reference Include="Microsoft.SqlServer.Smo, Version=9.0.242.0,
Culture=neutral, PublicKeyToken=89845dcd8080cc91,
processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\lib\SqlServer\Microsoft.SqlServer.Smo.dll</HintPath>
- <Private>True</Private>
- </Reference>
- <Reference Include="NAnt.Core, Version=0.85.2478.0, Culture=neutral">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\lib\NAnt\NAnt.Core.dll</HintPath>
- </Reference>
<Reference Include="NHibernate, Version=2.1.0.1001, Culture=neutral,
processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\NHibernate\2.0.0\NHibernate.dll</HintPath>
</Reference>
- <Reference Include="nunit.framework, Version=2.4.3.0, Culture=neutral,
PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\lib\NUnit\2.4.3\nunit.framework.dll</HintPath>
- </Reference>
<Reference Include="StructureMap, Version=2.5.0.0, Culture=neutral,
PublicKeyToken=e60ad81abae3c223, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\StructureMap\2.5\StructureMap.dll</HintPath>
=======================================
--- /trunk/src/Tarantino.IntegrationTests/DatabaseTesterBase.cs Mon Jun 30
08:38:23 2008
+++ /trunk/src/Tarantino.IntegrationTests/DatabaseTesterBase.cs Tue Dec 29
13:18:46 2009
@@ -1,5 +1,8 @@
using System.Collections.Generic;
+using System.Reflection;
+using NHibernate;
using NUnit.Framework;
+using NUnit.Framework.SyntaxHelpers;
using Tarantino.Core.Commons.Model;
using Tarantino.Infrastructure;
using Tarantino.Infrastructure.Commons.DataAccess.ORMapper;
@@ -26,6 +29,37 @@
{
HybridSessionBuilder.ResetSession(ConfigurationFile);
}
+
+ protected void AssertObjectCanBePersisted<T>(T persistentObject) where
T : PersistentObject
+ {
+ using (ISession session = GetSession())
+ {
+ session.SaveOrUpdate(persistentObject);
+ session.Flush();
+ }
+
+ using (ISession session = GetSession())
+ {
+ var reloadedObject = session.Load<T>(persistentObject.Id);
+ Assert.That(reloadedObject, Is.EqualTo(persistentObject));
+ Assert.That(reloadedObject, Is.Not.SameAs(persistentObject));
+ AssertObjectsMatch(persistentObject, reloadedObject);
+ }
+ }
+
+ protected static void AssertObjectsMatch(object obj1, object obj2)
+ {
+ Assert.AreNotSame(obj1, obj2);
+ Assert.AreEqual(obj1, obj2);
+
+ var infos = obj1.GetType().GetProperties(BindingFlags.Instance |
BindingFlags.Public);
+ foreach (var info in infos)
+ {
+ var value1 = info.GetValue(obj1, null);
+ var value2 = info.GetValue(obj2, null);
+ Assert.AreEqual(value1, value2, string.Format("Property {0} doesn't
match", info.Name));
+ }
+ }

protected void ClearTables()
{

Reply all
Reply to author
Forward
0 new messages