public void Setup()
        {
            _mockMp3Representation = MockRepository.GenerateStub<IMp3Representation>();
            _mockMp3Representation.AlbumName = SomeAlbumName;
            _mockMp3Representation.ArtistName = SomeArtistName;
            _mockMp3Representation.FileName = SomeFileName;

            _mockFileSystem = MockRepository.GenerateStub<IFileSystem>();
            _mockFileSystem.Stub(system => system.GetAllMp3Files(SomeStartDirectory)).Return(new List<string> { SomeFileName });

            _mockMp3TagHierarchy = MockRepository.GenerateStub<IMp3TagsHierarchy>();
            _mockMp3TagHierarchy.Stub(hierarchy => hierarchy.Artists).Return(new List<string> {SomeArtistName});
            _mockMp3TagHierarchy.Stub(tagsHierarchy => tagsHierarchy.GetAlbumsForArtist(SomeArtistName)).Return(
                new List<string> {SomeAlbumName});

            _mockMp3TagHierarchy.Stub(
                mp3TagsHierarchy => mp3TagsHierarchy.GetSongsForAlbumOfArtist(SomeAlbumName, SomeArtistName)).Return(
                    new List<string> {SomeFileName});
            _mockMp3FileReader = MockRepository.GenerateStub<IMp3FileReader>();
            _mockMp3FileReader.Stub(reader => reader.RetrieveTagsFromMp3Files(new List<string> {SomeFileName})).Return(
                new List<IMp3Representation>
                    {
                        new Mp3Representation
                            {AlbumName = SomeAlbumName, ArtistName = SomeArtistName, FileName = SomeFileName}
                    });

            _mp3LibrarySorter = new Mp3LibrarySorter.Mp3LibrarySorter(_mockFileSystem, SomeStartDirectory, _mockMp3TagHierarchy, _mockMp3FileReader);
            _mp3LibrarySorter.CreateFoldersForArtists();
        }
Пример #2
0
 static void Main(string[] args)
 {
     var a = new Mp3LibrarySorter.Mp3LibrarySorter(new FileSystem(), @"c:\Viki\Music", new Mp3TagsHierarchy(), new Mp3FileReader());
     a.CreateFoldersForArtists();
        //     TagLib.File file = TagLib.File.Create(@"c:\testmp3\01 Egg Raid On Mojo.mp3");
     // Console.WriteLine(file.Tag);
     //var a = new Mp3LibrarySorter.Mp3LibrarySorter(new FileSystem(), @"c:\testmp3", new Mp3TagsHierarchy(), new Mp3FileReader());
     //a.CreateFoldersForArtists();
 }