Ejemplo n.º 1
0
        public override void TestFixtureSetUp()
        {
            base.TestFixtureSetUp();
            N2.Context.Replace(engine);

            Url.DefaultExtension = "/";
            Url.ApplicationPath = "/";
            fs = (FakeFileSystem)engine.Resolve<IFileSystem>();
            fs.BasePath = basePath;
            fs.PathProvider = new FakePathProvider(fs.BasePath);

            fs.DirectoryCreated += (s, e) => Triggered("DirectoryCreated", e);
            fs.DirectoryDeleted += (s, e) => Triggered("DirectoryDeleted", e);
            fs.DirectoryMoved += (s, e) => Triggered("DirectoryMoved", e);
            fs.FileCopied += (s, e) => Triggered("FileCopied", e);
            fs.FileDeleted += (s, e) => Triggered("FileDeleted", e);
            fs.FileMoved += (s, e) => Triggered("FileMoved", e);
            fs.FileWritten += (s, e) => Triggered("FileWritten", e);

            System.IO.Directory.Move(basePath, backupPath);
        }
        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);
        }