public GetInstallStatus ( ) : |
||
return |
public override InstallStatus GetInstallStatus()
{
if (_configuration == null || _localConfig == null)
{
return new InstallStatus(InstallStatusType.RequiresConfiguration);
}
var installStatus = new InstallStatus(InstallStatusType.Pending);
//now, let check if we've actually been installed
try
{
var isValid = ValidateSchema(_configuration);
if (isValid)
{
installStatus = new InstallStatus(InstallStatusType.Completed);
}
}
catch (Exception ex)
{
//if an exception is thrown other than an HibernateException then its probably attempted an install and failed
//such as invalid connection details
installStatus = new InstallStatus(InstallStatusType.TriedAndFailed, ex);
}
return installStatus;
}
public void NHibernateBootstrapper_Requires_Configuration() { var boot = new ProviderBootstrapper(null, null, new FakeFrameworkContext()); var status = boot.GetInstallStatus(); Assert.AreEqual(InstallStatusType.RequiresConfiguration, status.StatusType); }