Ejemplo n.º 1
0
 public ResourceTestContext(ResourceMode resourceMode = ResourceMode.Debug)
 {
     Mode    = resourceMode;
     _finder = new StubResourceFinder();
     _contentFilterPipelineMap = new ContentFilterPipelineMap();
     _scriptGroups             = new ResourceGroupManager(Mode);
     _styleGroups        = new ResourceGroupManager(Mode);
     _dependencyCache    = new InMemoryDependencyCache();
     _dependencyProvider = new StubDependencyProvider();
     _dependencyManager  = new DependencyManager(_finder, _dependencyCache, _scriptGroups, _styleGroups);
     _dependencyManager.MapProvider(".js", _dependencyProvider);
     _dependencyManager.MapProvider(".css", _dependencyProvider);
 }
Ejemplo n.º 2
0
 public ResourceTestContext(ResourceMode resourceMode = ResourceMode.Debug)
 {
     Mode = resourceMode;
     _innerFinder = new StubResourceFinder();
     _outerFinder = new ResourceModeFilteringFinder(resourceMode, _innerFinder);
     _contentFilterPipelineMap = new ContentFilterPipelineMap();
     _scriptGroups = new ResourceGroupManager(Mode);
     _styleGroups = new ResourceGroupManager(Mode);
     _dependencyCache = new InMemoryDependencyCache();
     _dependencyProvider = new StubDependencyProvider();
     _dependencyManager = new DependencyManager(_outerFinder, _dependencyCache, _scriptGroups, _styleGroups, resourceMode);
     _dependencyManager.MapProvider(".js", _dependencyProvider);
     _dependencyManager.MapProvider(".css", _dependencyProvider);
 }
Ejemplo n.º 3
0
 public StubResourceBuilder(string virtualPath, StubDependencyProvider dependencyProvider)
 {
     _dependencyProvider = dependencyProvider;
     _resource           = StubResource.WithPath(virtualPath);
 }
Ejemplo n.º 4
0
        private void SetupWithMode(ResourceMode resourceMode)
        {
            _dependencyProvider = new StubDependencyProvider();
            _resourceFinder = new StubResourceFinder();
            _dependencyCache = new InMemoryDependencyCache();
            _scriptGroups = new ResourceGroupManager(resourceMode);
            _styleGroups = new ResourceGroupManager(resourceMode);

            _dependencyManager = new DependencyManager(new ResourceModeFilteringFinder(resourceMode, _resourceFinder), _dependencyCache, _scriptGroups, _styleGroups,
                                                       resourceMode);
            _dependencyManager.MapProvider(".js", _dependencyProvider);
        }
Ejemplo n.º 5
0
 public StubResourceBuilder(string virtualPath, StubDependencyProvider dependencyProvider)
 {
     _dependencyProvider = dependencyProvider;
     _resource = StubResource.WithPath(virtualPath);
 }
        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));
        }