Exemple #1
0
        public void TranscodesOtherFormats()
        {
            var fakeFiles     = new string[] { "test.m4a" };
            var fakeMusicInfo = new MusicInfo()
            {
                Album  = "Test",
                Artist = "Test2"
            };

            var transcodedFile         = "test.mp3";
            var fakeMusicInfoReader    = new FakeMusicInfoReader(fakeMusicInfo);
            var importFolderInteractor = new FakeFolderInteractor(fakeFiles);
            var fakeTranscoder         = new FakeTranscoder();
            var library = new MemoryLibraryRepository();

            library.ClearLibrary();
            var importFolderWatcher = new ImportFolderWatcher(importFolderInteractor, fakeMusicInfoReader, library, fakeTranscoder);

            importFolderWatcher.ProcessFiles();

            var expectedLibraryPath = @"c:\temp\" + fakeMusicInfo.Artist + "\\" + fakeMusicInfo.Album + "\\" + transcodedFile;

            Assert.AreEqual(1, importFolderInteractor.MovedFiles.Count(), "There must one moved file");
            Assert.AreEqual(transcodedFile, importFolderInteractor.MovedFiles[0].SourceFile, "The file to move must be correct.");
            Assert.AreEqual(expectedLibraryPath, importFolderInteractor.MovedFiles[0].DestinationFile, "The file must be moved to the correct folder.");
            Assert.IsTrue(importFolderInteractor.DeletedFiles.Contains(fakeFiles[0]), "The original file must be deleted.");
            Assert.IsTrue(importFolderInteractor.DeletedFiles.Contains(expectedLibraryPath), "The library path must be deleted.");
            Assert.AreEqual(2, importFolderInteractor.DeletedFiles.Count(), "There must be 2 attempted file deletes.");
        }
Exemple #2
0
        public void TranscodesOtherFormats()
        {
            var fakeFiles = new string[] { "test.m4a" };
            var fakeMusicInfo = new MusicInfo()
            {
                Album = "Test",
                Artist = "Test2"
            };

            var transcodedFile = "test.mp3";
            var fakeMusicInfoReader = new FakeMusicInfoReader(fakeMusicInfo);
            var importFolderInteractor = new FakeFolderInteractor(fakeFiles);
            var fakeTranscoder = new FakeTranscoder();
            var library = new MemoryLibraryRepository();
            library.ClearLibrary();
            var importFolderWatcher = new ImportFolderWatcher(importFolderInteractor, fakeMusicInfoReader, library, fakeTranscoder);

            importFolderWatcher.ProcessFiles();

            var expectedLibraryPath = @"c:\temp\" + fakeMusicInfo.Artist + "\\" + fakeMusicInfo.Album + "\\" + transcodedFile;

            Assert.AreEqual(1, importFolderInteractor.MovedFiles.Count(), "There must one moved file");
            Assert.AreEqual(transcodedFile, importFolderInteractor.MovedFiles[0].SourceFile, "The file to move must be correct.");
            Assert.AreEqual(expectedLibraryPath, importFolderInteractor.MovedFiles[0].DestinationFile, "The file must be moved to the correct folder.");
            Assert.IsTrue(importFolderInteractor.DeletedFiles.Contains(fakeFiles[0]), "The original file must be deleted.");
            Assert.IsTrue(importFolderInteractor.DeletedFiles.Contains(expectedLibraryPath), "The library path must be deleted.");
            Assert.AreEqual(2, importFolderInteractor.DeletedFiles.Count(), "There must be 2 attempted file deletes.");
        }