Example #1
0
        private static void LoadFromConfiguration(IConfigurationManager configurationManager)
        {
            WebAssetConfigurationSection section = configurationManager.GetSection <WebAssetConfigurationSection>(WebAssetConfigurationSection.SectionName);

            if (section != null)
            {
                LoadGroups(section.StyleSheets, styleSheets, WebAssetDefaultSettings.StyleSheetFilesPath, WebAssetDefaultSettings.Version);
                LoadGroups(section.Scripts, scripts, WebAssetDefaultSettings.ScriptFilesPath, WebAssetDefaultSettings.Version);
            }
        }
        public SharedWebAssetTests()
        {
            defaultConfigurationManager = DI.Current.Resolve<IConfigurationManager>();

            var mockConfigurationManager = new Mock<IConfigurationManager>();
            DI.Current.Register<IConfigurationManager>(() => mockConfigurationManager.Object);

            section = new WebAssetConfigurationSection();
            section.StyleSheets.Add(new WebAssetGroupConfigurationElement
            {
                Name = "foo"
            });
            section.Scripts.Add(new WebAssetGroupConfigurationElement
            {
                Name = "bar"
            });
            mockConfigurationManager.Setup(c => c.GetSection<WebAssetConfigurationSection>(It.IsAny<string>())).Returns(section);
        }
Example #3
0
        public SharedWebAssetTests()
        {
            defaultConfigurationManager = DI.Current.Resolve <IConfigurationManager>();

            var mockConfigurationManager = new Mock <IConfigurationManager>();

            DI.Current.Register <IConfigurationManager>(() => mockConfigurationManager.Object);

            section = new WebAssetConfigurationSection();
            section.StyleSheets.Add(new WebAssetGroupConfigurationElement
            {
                Name = "foo"
            });
            section.Scripts.Add(new WebAssetGroupConfigurationElement
            {
                Name = "bar"
            });
            mockConfigurationManager.Setup(c => c.GetSection <WebAssetConfigurationSection>(It.IsAny <string>())).Returns(section);
        }