I had this very same problem - (no longer since we moved from Sqlite to Sql Server LocalDB for tests).
I do still have the code, what we did was provide a component which configures whether to use schemas or not, thus:
public class SqlLiteMappingsHelper : IMappingsHelper
{
public string TextColumnTableSpecification
{
get
{
// see sqlite faqs re: all varchars are very large whatever you specify
// http://www.sqlite.org/faq.html#q9
return "nvarchar(10)";
}
}
public bool SchemasEnabled
{
get { return false; }
}
}
(and one similar for sql server with SchemasEnabled = true
) - in the web app you tell your IoC container to use the sql server one and in your test app you use the Sqlite one. Then in your convention:
public void Apply(IClassInstance instance)
{
var helper = IoC.get<IMappingsHelper>();
if (instance.EntityType.Namespace.EndsWith("Model.OtherEntities") && helper.SchemasEnabled)
{
instance.Schema("OtherDatabase.dbo");
}
}