public static void SetupFS(bool sharingEnabled)
        {
            Zio.IFileSystem fs;
            var             rootfs = new Zio.FileSystems.PhysicalFileSystem();

            Zio.IFileSystem fsfav;
            if (sharingEnabled)
            {
                fsfav = new Zio.FileSystems.SubFileSystem(rootfs, Paths.Documents);
            }
            else
            {
                fsfav = new Zio.FileSystems.MemoryFileSystem();
            }
            if (PHPhotoLibrary.AuthorizationStatus == PHAuthorizationStatus.Authorized &&
                Globals.Database.CheckSetting(UserSettings.EnbalePhotoSharing, "1"))
            {
                var mfs = new Zio.FileSystems.MountFileSystem(fsfav, true);
                mfs.Mount("/" + Unishare.Apps.DarwinCore.PhotoFileSystem.FolderName, new Unishare.Apps.DarwinCore.PhotoFileSystem());
                fs = mfs;
            }
            else
            {
                fs = fsfav;
            }
            Globals.SetupFS(fs);
        }
        public static void SetupFS(string sharingRoot)
        {
            var rootfs = new Zio.FileSystems.PhysicalFileSystem();

            Zio.IFileSystem fsfav;
            if (!string.IsNullOrWhiteSpace(sharingRoot))
            {
                fsfav = new Zio.FileSystems.SubFileSystem(rootfs, sharingRoot);
            }
            else
            {
                fsfav = new Zio.FileSystems.MemoryFileSystem();
            }
            Globals.FileSystem = fsfav;
            try { Globals.CloudManager.FileSystem = fsfav; } catch { }
            try { Globals.CloudManager?.BroadcastingIveChanged(); } catch { }
        }
        public void Setup()
        {
            var logdir = TestRoot = Path.Combine(GetFolderPath(SpecialFolder.MyDocuments), "Personal Cloud");

            Directory.CreateDirectory(TestRoot);
            TestRoot = Path.Combine(TestRoot, "Test Container");
            if (Directory.Exists(TestRoot))
            {
                Assert.Inconclusive("Previous test session may have failed. Please ensure \""
                                    + Path.GetDirectoryName(TestRoot)
                                    + "\" is empty before starting a new session.");
                return;
            }

            Directory.CreateDirectory(TestRoot);

            Directory.CreateDirectory(logdir);

            Loggers = LoggerFactory.Create(builder => builder.//SetMinimumLevel(LogLevel.Trace).
                                           AddConsole(x => {
                x.TimestampFormat = "G";
            }));



#pragma warning disable CA2000 // Dispose objects before losing scope
            var pfs = new Zio.FileSystems.PhysicalFileSystem();
#pragma warning restore CA2000 // Dispose objects before losing scope
            pfs.CreateDirectory(pfs.ConvertPathFromInternal(TestRoot));
            var fs = new Zio.FileSystems.SubFileSystem(pfs, pfs.ConvertPathFromInternal(TestRoot), true);



            Server = new HttpProvider(10240, fs);
            Server.Start();

            var c   = new TopFolderClient($"http://localhost:10240", new byte[32], "");
            var dic = new Dictionary <string, IFileSystem>();
            dic["Files"] = c;
            Client       = new FileSystemContainer(dic, Loggers.CreateLogger("FileContainerWebApiTest"));
        }