Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
29 lines (26 sloc) 1.03 KB
using NHibernate.Tool.hbm2ddl;
using NUnit.Framework;
namespace TinyNH.DemoStore.Tests.Core.Domain.NHibernate
{
[TestFixture]
public class ConfigurationTests : DatabaseTests
{
[Test]
public void configuration_should_be_valid()
{
// Tests overall configuration
var configuration = ConfigurationStore.Configuration;
// This will catch any non-virtual properties on lazy entities
var sessionFactory = ConfigurationStore.SessionFactory;
}
[Test]
public void generated_schema_should_be_valid()
{
// Ensures that schema is valid - useful for 2 reasons:
// 1. It catches any invalid column names, e.g. unescaped SQL keywords
// 2. Generates sql script, useful for code-first approach
var configuration = ConfigurationStore.Configuration;
new SchemaExport(configuration).SetOutputFile("..\\..\\Generated\\schema.sql").Create(true, true);
}
}
}