Example #1
0
        public void CreateDirectoryShortcut()
        {
            using (var targetPath = new SIL.TestUtilities.TemporaryFolder(Path.GetRandomFileName()))
                using (var directory = new SIL.TestUtilities.TemporaryFolder(Path.GetRandomFileName()))
                {
                    ShortcutMaker.CreateDirectoryShortcut(targetPath.Path, directory.Path);

                    var expectedFile = Path.Combine(directory.Path, Path.GetFileName(targetPath.Path)) + ".lnk";
                    Assert.That(File.GetAttributes(expectedFile) & (FileAttributes.Directory | FileAttributes.Normal), Is.Not.Null);
                    Assert.That(ResolveShortcut.Resolve(expectedFile), Is.EqualTo(targetPath.Path));
                }
        }
        public void CreateDirectoryShortcut()
        {
            using (var targetPath = new SIL.TestUtilities.TemporaryFolder(Path.GetRandomFileName()))
            using (var directory = new SIL.TestUtilities.TemporaryFolder(Path.GetRandomFileName()))
            {
                ShortcutMaker.CreateDirectoryShortcut(targetPath.Path, directory.Path);

                var expectedFile = Path.Combine(directory.Path, Path.GetFileName(targetPath.Path)) + ".lnk";
                Assert.That(File.GetAttributes(expectedFile) & (FileAttributes.Directory | FileAttributes.Normal), Is.Not.Null);
                Assert.That(ResolveShortcut.Resolve(expectedFile), Is.EqualTo(targetPath.Path));
            }
        }
        public void Setup()
        {
            Logger.Init();
            _folder = new TemporaryFolder("ImageServerTests");
            var localizationDirectory = FileLocator.GetDirectoryDistributedWithApplication("localization");

            LocalizationManager.Create("fr", "Bloom", "Bloom", "1.0.0", localizationDirectory, "SIL/Bloom", null, "", new string[] { });


            ErrorReport.IsOkToInteractWithUser = false;
            _collectionPath = Path.Combine(_folder.Path, "TestCollection");
            var cs = new CollectionSettings(Path.Combine(_folder.Path, "TestCollection.bloomCollection"));

            _fileLocator = new BloomFileLocator(cs, new XMatterPackFinder(new string[] { BloomFileLocator.GetInstalledXMatterDirectory() }), ProjectContext.GetFactoryFileLocations(),
                                                ProjectContext.GetFoundFileLocations(), ProjectContext.GetAfterXMatterFileLocations());
        }
        public void Setup()
        {
            Logger.Init();
            _folder = new TemporaryFolder("ImageServerTests");
            var localizationDirectory = FileLocator.GetDirectoryDistributedWithApplication("localization");
            LocalizationManager.Create("fr", "Bloom", "Bloom", "1.0.0", localizationDirectory, "SIL/Bloom", null, "", new string[] { });

            ErrorReport.IsOkToInteractWithUser = false;
            _collectionPath = Path.Combine(_folder.Path, "TestCollection");
            var cs = new CollectionSettings(Path.Combine(_folder.Path, "TestCollection.bloomCollection"));
            _fileLocator = new BloomFileLocator(cs, new XMatterPackFinder(new string[] { BloomFileLocator.GetInstalledXMatterDirectory() }), ProjectContext.GetFactoryFileLocations(),
                ProjectContext.GetFoundFileLocations(), ProjectContext.GetAfterXMatterFileLocations());
        }