Example #1
0
        public void EmptyFile()
        {
            var fileName = "FavoriteMappers_Empty.ini";
            var filePath = Path.Combine(DataPath, fileName);

            Assert.IsTrue(File.Exists(filePath));
            var favoriteMappers = new FavoriteMappers(filePath);

            favoriteMappers.Initialize();
            Assert.AreEqual(0, favoriteMappers.Mappers.Count);
        }
Example #2
0
        public void NonexistantFile()
        {
            var fileName = "FavoriteMappers_DoesntExist.ini";
            var filePath = Path.Combine(DataPath, fileName);

            Assert.IsFalse(File.Exists(filePath));
            var favoriteMappers = new FavoriteMappers(filePath);

            favoriteMappers.Initialize();
            Assert.AreEqual(0, favoriteMappers.Mappers.Count);
        }
Example #3
0
        //private TransformBlock<PlaylistSong, JobResult> DownloadBatch;

        public SongDownloader(PluginConfig config, HistoryManager historyManager, SongHasher hashSource, string customLevelsPath)
        {
            CustomLevelsPath = customLevelsPath;
            Directory.CreateDirectory(CustomLevelsPath);
            HashSource      = hashSource;
            DownloadQueue   = new ConcurrentQueue <PlaylistSong>();
            HistoryManager  = historyManager;
            FavoriteMappers = new FavoriteMappers();
            FavoriteMappers.Initialize();
            Config = config.Clone();
        }
Example #4
0
        public void NewLineAtMiddle()
        {
            var fileName = "FavoriteMappers_NewLineAtMiddle.ini";
            var filePath = Path.Combine(DataPath, fileName);

            Assert.IsTrue(File.Exists(filePath));
            var favoriteMappers = new FavoriteMappers(filePath);

            favoriteMappers.Initialize();
            Assert.AreEqual(6, favoriteMappers.Mappers.Count);
            foreach (var mapper in DefaultMappers)
            {
                Assert.IsTrue(favoriteMappers.Mappers.Contains(mapper));
            }
        }