これが私ができるようになりたいことです。
/// <summary>
/// Gets the session factory.
/// </summary>
/// <value>The session factory.</value>
public ISessionFactory SessionFactory
{
get
{
if (_sessionFactory == null)
{
#if(NUNIT)
_sessionFactory = Fluently.Configure()
.Database(SQLiteConfiguration.Standard
.UsingFile(DbFile)
.ShowSql())
.Mappings(m =>
m.FluentMappings.AddFromAssemblyOf<ForeignFormat>())
.ExposeConfiguration(BuildSchema)
.BuildSessionFactory();
#else
_sessionFactory = Fluently.Configure()
.Database(MsSqlConfiguration.MsSql2005
.ConnectionString(c => c
.Server(".\\sqlexpress")
.Database("mPort")
.TrustedConnection())
.ShowSql()
)
.Mappings(m => m
.FluentMappings.AddFromAssemblyOf<ForeignFormat>())
.BuildSessionFactory();
#endif
}
return _sessionFactory;
}
}
単体テストを実行している場合、条件付きの #if は可能ですか?