Exemple #1
0
 public void SetupContext()
 {
     DependencyManagerFactory.ClearDependencyCache();
     _finder  = new StubResourceFinder();
     _context = new AssmanContext(ResourceMode.Release);
     _context.AddFinder(_finder);
 }
Exemple #2
0
        public void Init()
        {
            _finder = new StubResourceFinder();
            _finder.CreateResource(myScript);
            _finder.CreateResource(mySecondScript);
            _finder.CreateResource(excludedScript);

            _dependencyProvider = new StubDependencyProvider();
            DependencyManagerFactory.ClearDependencyCache();

            _instance = AssmanContext.Create(ResourceMode.Debug);
            _instance.ConsolidateScripts        = true;
            _instance.ConfigurationLastModified = DateTime.MinValue;
            _instance.AddFinder(_finder);
            _instance.MapExtensionToDependencyProvider(".js", _dependencyProvider);
            _groupElement = new ScriptGroupElement();
            _groupElement.ConsolidatedUrl = consolidatedScript;
            _groupElement.Exclude.AddPattern(excludedScript);
            _instance.ScriptGroups.Add(_groupElement);
        }
Exemple #3
0
        public void Init()
        {
            _finder = new StubResourceFinder();
            _finder.CreateResource(myScript);
            _finder.CreateResource(mySecondScript);
            _finder.CreateResource(excludedScript);

            _dependencyProvider = new StubDependencyProvider();
            DependencyManagerFactory.ClearDependencyCache();

            _context = AssmanContext.Create(ResourceMode.Debug);
            _context.ConsolidateScripts        = true;
            _context.ConfigurationLastModified = DateTime.MinValue;
            _context.AddFinder(_finder);
            _context.MapExtensionToDependencyProvider(".js", _dependencyProvider);
            _groupElement = new ScriptGroupElement();
            _groupElement.ConsolidatedUrl = consolidatedScript;
            _groupElement.Exclude.AddPattern(excludedScript);
            _context.ScriptGroups.Add(_groupElement);

            _registry = new ConsolidatingResourceRegistry(new ResourceRequirementCollection(), "Default", _context.ScriptPathResolver, new ConfiguredVersioningStrategy(() => _context.Version));
        }