コード例 #1
0
        public void ConvertToList()
        {
            var model = new ConfigurationModel();

            model.AppSettings = new Dictionary <string, string> {
                { "Test", "Pest" }, { "Jester", "Wester" }
            };
            model.Authentication    = new ConfigurationAuthenticationModel();
            model.ConnectionStrings = new List <ConfigurationConnectionStringModel> {
                new ConfigurationConnectionStringModel(), new ConfigurationConnectionStringModel()
            };
            model.CustomErrors = new ConfigurationCustomErrorsModel();
            model.HttpHandlers = new List <ConfigurationHttpHandlersModel> {
                new ConfigurationHttpHandlersModel(), new ConfigurationHttpHandlersModel()
            };
            model.HttpModules = new List <ConfigurationHttpModulesModel> {
                new ConfigurationHttpModulesModel(), new ConfigurationHttpModulesModel()
            };
            model.RoleManager = new ConfigurationRoleManagerModel();

            var converter = new ConfigurationModelConverter();
            var result    = converter.Convert(model) as IDictionary <object, object>;

            Assert.NotNull(result);
            Assert.True(result.Count > 0);
        }
コード例 #2
0
        public void ConvertToList()
        {
            var model = new ConfigurationModel();
            model.AppSettings = new Dictionary<string, string> { { "Test", "Pest" }, { "Jester", "Wester" } };
            model.Authentication = new ConfigurationAuthenticationModel();
            model.ConnectionStrings = new List<ConfigurationConnectionStringModel> { new ConfigurationConnectionStringModel(), new ConfigurationConnectionStringModel() };
            model.CustomErrors = new ConfigurationCustomErrorsModel();
            model.HttpHandlers = new List<ConfigurationHttpHandlersModel> { new ConfigurationHttpHandlersModel(), new ConfigurationHttpHandlersModel() };
            model.HttpModules = new List<ConfigurationHttpModulesModel> { new ConfigurationHttpModulesModel(), new ConfigurationHttpModulesModel() };
            model.RoleManager = new ConfigurationRoleManagerModel();

            var converter = new ConfigurationModelConverter();
            var result = converter.Convert(model) as IDictionary<object, object>;
             
            Assert.NotNull(result);
            Assert.True(result.Count > 0); 
        }