Beispiel #1
0
        public void Init()
        {
            _now          = DateTime.Now;
            _lastModified = _now.AddYears(-1);
            var resources = new ResourceCollection
            {
                CreateResource("Content1", _lastModified.AddDays(-3)),
                CreateResource("Content2", _lastModified),
                CreateResource("Content3", _lastModified.AddDays(-10))
            };

            _finder = new Mock <IResourceFinder>();
            _finder.Setup(f => f.FindResources(_resourceType)).Returns(resources);

            var groupTemplate = new StubResourceGroupTemplate(new ResourceGroup(VirtualPath, resources));

            groupTemplate.ResourceType = _resourceType;

            var configContext = new AssmanContext(ResourceMode.Debug);

            configContext.AddFinder(_finder.Object);

            _instance = new DynamicallyConsolidatedResourceHandler(VirtualPath, configContext.GetCompiler(), groupTemplate.WithEmptyContext())
            {
                Now = () => _now
            };
        }
        public void Init()
        {
            _now = DateTime.Now;
            _lastModified = _now.AddYears(-1);
            var resources = new ResourceCollection
            {
                CreateResource("Content1", _lastModified.AddDays(-3)),
                CreateResource("Content2", _lastModified),
                CreateResource("Content3", _lastModified.AddDays(-10))
            };
            _finder = new Mock<IResourceFinder>();
            _finder.Setup(f => f.FindResources(_resourceType)).Returns(resources);

            var groupTemplate = new StubResourceGroupTemplate(new ResourceGroup(VirtualPath, resources));
            groupTemplate.ResourceType = _resourceType;

            var configContext = new AssmanContext(ResourceMode.Debug);
            configContext.AddFinder(_finder.Object);

            _instance = new DynamicallyConsolidatedResourceHandler(VirtualPath, configContext.GetCompiler(), groupTemplate.WithEmptyContext())
            {
                Now = () => _now
            };
        }