Beispiel #1
0
        public override void SetUp()
        {
            base.SetUp();

            root  = CreateOneItem <RootNode>(1, "root", null);
            start = CreateOneItem <RootNode>(2, "start", root);
            host  = new Host(new ThreadContext(), root.ID, start.ID);

            fs          = new FakeMappedFileSystem();
            fs.BasePath = AppDomain.CurrentDomain.BaseDirectory + @"\FileSystem\";

            vnf    = new VirtualNodeFactory();
            config = new EditSection();

            injector = new FakeDependencyInjector();
            injector.injectors.Add(new EntityDependencySetter <IFileSystem>(fs));
            injector.injectors.Add(new EntityDependencySetter <IDependencyInjector>(injector));
            var sizeCache = new ImageSizeCache(new ConfigurationManagerWrapper {
                Sections = new ConfigurationManagerWrapper.ContentSectionTable(null, null, null, config)
            });

            injector.injectors.Add(new EntityDependencySetter <ImageSizeCache>(sizeCache));
            //nodeProvider = new FolderNodeProvider(fs, persister, injector);
            //initializer = new VirtualFolderInitializer(host, persister, fs, vnf, new Plugin.ConnectionMonitor().SetConnected(SystemStatusLevel.UpAndRunning), config, new ImageSizeCache(new ConfigurationManagerWrapper { Sections = new ConfigurationManagerWrapper.ContentSectionTable(null, null, null, config) }), nodeProvider);
            //nodeProvider = new FolderNodeProvider(fs, persister, injector);
            //nodeProvider = new FolderNodeProvider(fs, persister, injector);
            nodeProvider = new FolderNodeProvider(fs, persister.Repository, injector);
            initializer  = new VirtualFolderInitializer(host, persister, fs, vnf, monitor = new Plugin.ConnectionMonitor().SetConnected(SystemStatusLevel.UpAndRunning), new UploadFolderSource(host, config), nodeProvider);
        }
Beispiel #2
0
        public void Get_UploadFolder2()
        {
            fs.CreateDirectory("/upload2/");
            config.UploadFolders.Add("/upload2/");
            initializer = new VirtualFolderInitializer(host, persister, fs, vnf, monitor, new UploadFolderSource(host, config), nodeProvider);

            initializer.Start();
            vnf.Register(nodeProvider);

            var result = vnf.Get("/upload2/");

            Assert.That(result, Is.Not.Null);
            Assert.That(result.Name, Is.EqualTo("upload2"));
        }
Beispiel #3
0
        public void GetChildren_Includes_UploadFolder2()
        {
            fs.CreateDirectory("/upload2/");
            config.UploadFolders.Add("/upload2/");
            initializer = new VirtualFolderInitializer(host, persister, fs, vnf, monitor, new UploadFolderSource(host, config), nodeProvider);

            initializer.Start();
            vnf.Register(nodeProvider);

            var result = vnf.GetChildren("/");

            Assert.That(result.Count(), Is.EqualTo(2));
            Assert.That(result.Any(r => r.Name == "upload"));
            Assert.That(result.Any(r => r.Name == "upload2"));
        }
Beispiel #4
0
        public override void SetUp()
        {
            base.SetUp();

            root  = CreateOneItem <RootNode>(1, "root", null);
            start = CreateOneItem <RootNode>(2, "start", root);
            host  = new Host(new ThreadContext(), root.ID, start.ID);

            fs = new FakeFileSystem();
            fs.PathProvider = new FakePathProvider(fs.BasePath);

            vnf    = new VirtualNodeFactory();
            config = new EditSection();

            initializer = new VirtualFolderInitializer(host, persister, fs, vnf, new FakeStatus(), config);
        }