/// <summary>
/// The common test setup code. To activate it in a specific test framework,
/// it must be called from a framework-specific setup-Method.
/// </summary>
public virtual void SetUp()
{
ActiveRecordStarter.ResetInitializationFlag();
Dictionary<string, string> properties = new Dictionary<string, string>();
properties.Add("connection.driver_class", "NHibernate.Driver.SQLite20Driver");
properties.Add("dialect", "NHibernate.Dialect.SQLiteDialect");
properties.Add("connection.provider", typeof(InMemoryConnectionProvider).AssemblyQualifiedName);
properties.Add("connection.connection_string", "Data Source=:memory:;Version=3;New=True");
properties.Add("proxyfactory.factory_class", "NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle");
foreach (var p in GetProperties())
{
properties[p.Key] = p.Value;
}
var config = new InPlaceConfigurationSource();
config.Add(typeof(ActiveRecordBase), properties);
foreach (var type in GetAdditionalBaseClasses())
{
config.Add(type, properties);
}
Configure(config);
var types = GetTypes();
var assemblies = GetAssemblies();
if (types == null) types = new Type[0];
if (assemblies == null) assemblies = new Assembly[0];
ActiveRecordStarter.Initialize(assemblies,config,types);
ActiveRecordStarter.CreateSchema();
}