static ConfigurationSettings()
        {
            var adaptors = new List <IConfigurationAdaptor>(3);

            if (LoadConfigurationFromServer)
            {
                var config = new ServerConfigurationAdaptor();
                config.Load(null);
                adaptors.Add(config);
            }

            if (AzureEnvironment.RoleIsAvailable)
            {
                adaptors.Add(new RoleEnvironmentAdaptor());
            }

            Settings.Instance.Add(adaptors);
        }
Пример #2
0
        public void Configuration()
        {
            var table   = new AzureTable <ApplicationConfiguration>(CloudStorageAccount.DevelopmentStorageAccount);
            var configs = table.QueryByPartition(ConfigurationSettings.ApplicationIdentifier.ToString()).ToList();

            var adaptor     = new ServerConfigurationAdaptor();
            var datumConfig = adaptor.Configuration;

            foreach (var item in configs)
            {
                if (!datumConfig.ContainsKey(item.RowKey))
                {
                    Assert.Fail("Unknown Key");
                }
                else if (item.Value != datumConfig[item.RowKey])
                {
                    Assert.Fail("Value is not equal?");
                }
            }
        }
Пример #3
0
        public void Load()
        {
            var adaptor = new ServerConfigurationAdaptor();

            adaptor.Load(new object());
        }
Пример #4
0
        public void LoadNull()
        {
            var adaptor = new ServerConfigurationAdaptor();

            adaptor.Load(null);
        }