public override void SetUp()
        {
            base.SetUp();
			
			CopyFilesRecursively(new DirectoryInfo(backupPath), new DirectoryInfo(basePath));

			operations = new List<string>();
			arguments = new List<FileEventArgs>();

			root = engine.Resolve<ContentActivator>().CreateInstance<RootNode>(null);
			engine.Persister.Save(root);
			engine.Resolve<IHost>().DefaultSite.RootItemID = root.ID;
			engine.Resolve<IHost>().DefaultSite.StartPageID = root.ID;

			upload = engine.Resolve<ContentActivator>().CreateInstance<RootDirectory>(root);
            upload.Title = "Upload";
            upload.Name = "Upload";
			engine.Persister.Save(upload);			
		}
Beispiel #2
0
		private void SetupFileSystem(out RootDirectory rootDir, out FakeMemoryFileSystem fs)
		{
			rootDir = CreateOneItem<RootDirectory>(4, "FileSystem", root);
			((IInjectable<IUrlParser>)rootDir).Set(TestSupport.Setup(persister, new FakeWebContextWrapper(), new Host(null, 1, 1)));
			fs = new FakeMemoryFileSystem();
			fs.directories["/FileSystem/upload/"] = new DirectoryData { Name = "upload" };
		
			rootDir.Set(fs);
			rootDir.Set(new ImageSizeCache(new ConfigurationManagerWrapper { Sections = new ConfigurationManagerWrapper.ContentSectionTable(null, null, null, new EditSection()) }));
			
			var injector = new FakeDependencyInjector();
			injector.injectors.Add(new EntityDependencySetter<IFileSystem>(fs));
			injector.injectors.Add(new EntityDependencySetter<ImageSizeCache>(new ImageSizeCache(new ConfigurationManagerWrapper())));
			rootDir.Set(injector);
		}