Example #1
0
        public void ReadDbConfigurationTest()
        {
            Assert.IsNotNull(_LibManager, "Library settings manager can't be null, but it is.");

            DragonflyConfig currentConfig = null;

            currentConfig = ReadCurrentConfiguration();
            Assert.IsNotNull(
                currentConfig,
                "Return empty configuration after reading.");
            Assert.IsNotNull(
                currentConfig.DbConfiguration,
                "Return empty DB configuration after reading.");

            try
            {
                DatabaseAccessConfiguration accessConfig = _Raader.GetDbAccessSettings();
                Assert.IsNotNull(accessConfig, "Reader was returned an empty db config.");
                Assert.AreEqual(currentConfig.DbConfiguration.DbAddress, accessConfig.ServerName);
                Assert.AreEqual(currentConfig.DbConfiguration.DbName, accessConfig.DbName);
                Assert.AreEqual(currentConfig.DbConfiguration.DefaultUserName, accessConfig.UserName);
                Assert.AreEqual(currentConfig.DbConfiguration.DefaultUserPassword, accessConfig.Password);
            }
            finally
            {
            }
        }
Example #2
0
        static BaseBindings()
        {
            SettingsReader   = new SettingsLibReader();
            _DbFactory       = new MsSqlFactory(SettingsReader.GetDbAccessSettings());
            _CooksManager    = new CookieMananger();
            _UsrStateManager = new UserAuthenticateStateManager(_DbFactory, _CooksManager);

            _LogConfiguration = new BasicNLogConfig(SettingsReader.GetLogDirectory());
            _LogConfiguration.InitConfig();

            _Lg = LogManager.GetCurrentClassLogger();
            _Lg.Info("Basic bindings initialized successguly.");
        }