Rebel.Framework.Persistence.NHibernate.ProviderBootstrapper.GetInstallStatus C# (CSharp) Method

GetInstallStatus() public method

public GetInstallStatus ( ) : InstallStatus
return Rebel.Framework.ProviderSupport.InstallStatus
        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;
        }

Usage Example

        public void NHibernateBootstrapper_Requires_Configuration()
        {
            var boot = new ProviderBootstrapper(null, null, new FakeFrameworkContext());

            var status = boot.GetInstallStatus();

            Assert.AreEqual(InstallStatusType.RequiresConfiguration, status.StatusType);
        }
All Usage Examples Of Rebel.Framework.Persistence.NHibernate.ProviderBootstrapper::GetInstallStatus