public void TestArtistReader_GetCommonArtist()
        {
            var artist           = TestAlbumFileReader.GetFNM();
            var commonFromArtist = ArtistReader.GetMostCommonArtistNameFromAlbums(artist);

            Assert.AreEqual("Faith No More", commonFromArtist);
        }
Example #2
0
        public void TestStandardiseFacade()
        {
            var artist = TestAlbumFileReader.GetFNM();
            var facade = new Mp3StandardiseFacade(_settings);

            facade.StandardiseArtist(artist);

            var albumOfTheYear = artist.Albums[0];

            foreach (IMp3 mp3 in albumOfTheYear.Tracks())
            {
                Assert.AreEqual("Album Of The Year", mp3.Album);
                Assert.AreEqual("Faith No More", mp3.Artist);
                Assert.AreEqual("Faith No More", mp3.AlbumArtist);
                Assert.AreEqual("1997", mp3.Year);
            }

            var angelDust = artist.Albums[1];

            foreach (IMp3 mp3 in angelDust.Tracks())
            {
                Assert.AreEqual("Angel Dust", mp3.Album);
                Assert.AreEqual("Faith No More", mp3.Artist);
                Assert.AreEqual("Faith No More", mp3.AlbumArtist);
                Assert.AreEqual("1992", mp3.Year);
            }
        }
Example #3
0
        public static IAlbum GetPerfectDeafheavenAlbum()
        {
            var artist = "Deafheaven";
            var album  = "Roads To Judah";
            var year   = "2011";
            var reader = new TestAlbumFileReader();

            reader._albumTracks.Add(new TestMp3()
            {
                Track = "1", Title = "Violent", BitRate = 128, Artist = artist, Album = album, AlbumArtist = artist, FullFilePath = "l:\test01.mp3", Year = year
            });
            reader._albumTracks.Add(new TestMp3()
            {
                Track = "2", Title = "Language Games", BitRate = 128, Artist = artist, Album = album, AlbumArtist = artist, FullFilePath = "l:\test02.mp3", Year = year
            });
            reader._albumTracks.Add(new TestMp3()
            {
                Track = "3", Title = "Unrequited", BitRate = 128, Artist = artist, Album = album, AlbumArtist = artist, FullFilePath = "l:\test03.mp3", Year = year
            });
            reader._albumTracks.Add(new TestMp3()
            {
                Track = "4", Title = "Tunnel Of Trees", BitRate = 128, Artist = artist, Album = album, AlbumArtist = artist, FullFilePath = "l:\test04.mp3", Year = year
            });
            return(new Album(album, artist, reader));
        }
Example #4
0
        public static IAlbum GetImperfectDeafheavenAlbum()
        {
            var artist = "Deafheaven";
            var album  = "Roads To Judah";
            var year   = "2011";
            var reader = new TestAlbumFileReader();

            reader._albumTracks.Add(new TestMp3()
            {
                Track = "01", Title = "VIOLENT", BitRate = 320, Artist = artist, Album = album, AlbumArtist = artist, FullFilePath = "c:\test01.mp3", Year = year
            });
            reader._albumTracks.Add(new TestMp3()
            {
                Track = "02", Title = "Languge Games", BitRate = 320, Artist = artist, Album = album, AlbumArtist = artist, FullFilePath = "c:\test02.mp3", Year = "2010"
            });
            reader._albumTracks.Add(new TestMp3()
            {
                Track = "03", Title = "Unrequited", BitRate = 320, Artist = "DEAFHEAVEN", Album = album, AlbumArtist = "", FullFilePath = "c:\test03.mp3", Year = year
            });
            reader._albumTracks.Add(new TestMp3()
            {
                Track = "04", Title = "TunnelOfTrees", BitRate = 320, Artist = artist, Album = "RoadsToJudah", AlbumArtist = "", FullFilePath = "c:\test04.mp3", Year = year
            });
            return(new Album(album, artist, reader));
        }
Example #5
0
        public void TestAlbumFormatFactoryForGavStyle()
        {
            var reader = new TestAlbumFileReader();
            var album  = new Album("Ride The Lightning", "Metallica", reader);
            var artist = new Artist("Metallica");

            var mp3 = new TestMp3
            {
                Album       = "Ride The Lightning",
                AlbumArtist = "",
                Artist      = "Metallica",
                Track       = "03",
                Title       = "03 - For Whom The Bell Tolls",
                Year        = "1984"
            };

            var albumFormatter = AlbumFormatFactory.GetAlbumFormatter(FormatStyle.Gav);

            var expectedPath = Path.Combine(_settings.OutputDirectoryPath, "Metallica", "Ride The Lightning");
            var path         = albumFormatter.GetFolderToWriteTo(_settings.OutputDirectoryPath, artist, album);

            Assert.AreEqual(expectedPath, path.FullName);

            albumFormatter.FormatMp3Tags(mp3, album);

            Assert.AreEqual("3", mp3.Track);
            Assert.AreEqual("Metallica", mp3.AlbumArtist);
            Assert.AreEqual("For Whom The Bell Tolls", mp3.Title);
        }
Example #6
0
        private void PopulateWithTestValues()
        {
            var reader         = TestAlbumFileReader.GetFNMAlbumFileReader();
            var fnm            = new Artist("Faith No More");
            var albumOfTheYear = new Album("Album Of The Year", "Faith no More", reader);

            _artistList.Add(fnm);
        }
        public void TestAlbumFileReader_GetCommonAlbumTitle()
        {
            var reader = TestAlbumFileReader.GetFNMAlbumFileReader();
            var album  = new Album("Album of the Year", "Faith No More", reader);

            var commonName = AlbumReader.GetMostCommonAlbumTitleFromTracks(album);

            Assert.AreEqual("Album Of The Year", commonName);
        }
        public void TestAlbumsAverageBitRate()
        {
            var reader = TestAlbumFileReader.GetFNMAlbumFileReader();
            var album  = new Album("Album of the Year", "Faith No More", reader);

            var avgBitRate = album.GetAverageBitRateFromTracks();

            Assert.AreEqual(192, avgBitRate);
        }
Example #9
0
        public static IAlbumFileReader GetFNMAlbumFileReader()
        {
            var reader = new TestAlbumFileReader();

            reader._albumTracks.Add(new TestMp3()
            {
                Track = "1", Title = "Collision", Year = "1997", BitRate = 192, Artist = "Faith No More", Album = "Album Of The Year"
            });
            reader._albumTracks.Add(new TestMp3()
            {
                Track = "2", Title = "Stripsearch", Year = "1997", BitRate = 192, Artist = "Faith No More", Album = "Album of the Year"
            });
            reader._albumTracks.Add(new TestMp3()
            {
                Track = "3", Title = "Last Cup Of Sorrow", Year = "1997", BitRate = 192, Artist = "Faith No More", Album = "Album of The Year"
            });
            reader._albumTracks.Add(new TestMp3()
            {
                Track = "4", Title = "Naked Infront of the Computer", Year = "1997", BitRate = 192, Artist = "Faith No More", Album = "Album Of The Year"
            });
            reader._albumTracks.Add(new TestMp3()
            {
                Track = "5", Title = "Helpless", Year = "1997", BitRate = 192, Artist = "Faith No More", Album = "Album Of The Year"
            });
            reader._albumTracks.Add(new TestMp3()
            {
                Track = "6", Title = "Mouth To Mouth", Year = "1997", BitRate = 192, Artist = "Faith No More", Album = "Album Of The Year"
            });
            reader._albumTracks.Add(new TestMp3()
            {
                Track = "7", Title = "Ashes to Ashes", Year = "1997", BitRate = 192, Artist = "Faith No More", Album = "Album of the Year"
            });
            reader._albumTracks.Add(new TestMp3()
            {
                Track = "8", Title = "She Loves Me Not", Year = "1997", BitRate = 128, Artist = "Faith no More", Album = "album of the year"
            });
            reader._albumTracks.Add(new TestMp3()
            {
                Track = "9", Title = "Got That Feeling", Year = "1997", BitRate = 192, Artist = "Faith no More", Album = "Album Of The Year"
            });
            reader._albumTracks.Add(new TestMp3()
            {
                Track = "10", Title = "Paths of Glory", Year = "1997", BitRate = 192, Artist = "Faith No More", Album = "Album Of The Year"
            });
            reader._albumTracks.Add(new TestMp3()
            {
                Track = "11", Title = "Home Sick Home", Year = "1997", BitRate = 320, Artist = "faith no more", Album = "Album Of The Year"
            });
            reader._albumTracks.Add(new TestMp3()
            {
                Track = "12", Title = "Pristina", Year = "1997", BitRate = 192, Artist = "Faith No More", Album = "Album Of The Year"
            });

            return(reader);
        }
Example #10
0
        public static IArtist GetFNM()
        {
            var aoyReader   = TestAlbumFileReader.GetFNMAlbumFileReader();
            var albumOfYear = new Album("Album of the Year", "Faith No More", aoyReader);
            var adReader    = TestAlbumFileReader.GetFNMAngelFileReader();
            var angelDust   = new Album("Angel Dust", "Faith No More", adReader);

            var artist = new Artist("faith no more");

            artist.AddAlbum(albumOfYear);
            artist.AddAlbum(angelDust);

            return(artist);
        }
        public void TestAlbumFileReader_GetCommonArtist()
        {
            var reader = TestAlbumFileReader.GetFNMAlbumFileReader();
            var album  = new Album("Album of the Year", "Faith No More", reader);

            var commonArtist = AlbumReader.GetMostCommonArtistNameFromTracks(album);

            Assert.AreEqual("Faith No More", commonArtist);

            var artist = new Artist("Faith no More");

            artist.AddAlbum(album);

            var commonFromArtist = ArtistReader.GetMostCommonArtistNameFromAlbums(artist);

            Assert.AreEqual("Faith No More", commonArtist);
        }
Example #12
0
        public static IAlbumFileReader GetFNMAngelFileReader()
        {
            var artist = "Faith No More";
            var album  = "Angel Dust";
            var year   = "1992";

            var reader = new TestAlbumFileReader();

            reader._albumTracks.Add(new TestMp3()
            {
                Track = "1", Title = "Land Of Sunshine", Year = year, BitRate = 192, Artist = artist, Album = album, AlbumArtist = artist
            });
            reader._albumTracks.Add(new TestMp3()
            {
                Track = "2", Title = "Caffeine", Year = year, BitRate = 192, Artist = "Faith No More", Album = album, AlbumArtist = artist
            });
            reader._albumTracks.Add(new TestMp3()
            {
                Track = "3", Title = "Midlife Crisis", Year = year, BitRate = 192, Artist = artist, Album = album, AlbumArtist = artist
            });
            reader._albumTracks.Add(new TestMp3()
            {
                Track = "4", Title = "RV", Year = "1997", BitRate = 192, Artist = "Faith No More", Album = album, AlbumArtist = artist
            });
            reader._albumTracks.Add(new TestMp3()
            {
                Track = "5", Title = "Smaller And Smaller", Year = year, BitRate = 192, Artist = artist, Album = album, AlbumArtist = artist
            });
            reader._albumTracks.Add(new TestMp3()
            {
                Track = "6", Title = "Everything's Ruined", Year = year, BitRate = 192, Artist = artist, Album = album, AlbumArtist = artist
            });
            reader._albumTracks.Add(new TestMp3()
            {
                Track = "7", Title = "Malpractice", Year = year, BitRate = 192, Artist = artist, Album = album, AlbumArtist = artist
            });
            reader._albumTracks.Add(new TestMp3()
            {
                Track = "8", Title = "Kindergarten", Year = year, BitRate = 128, Artist = "Faith no More", Album = "angel dust", AlbumArtist = artist
            });
            reader._albumTracks.Add(new TestMp3()
            {
                Track = "9", Title = "Be Aggressive", Year = year, BitRate = 192, Artist = "Faith no More", Album = "angel dust", AlbumArtist = artist
            });
            reader._albumTracks.Add(new TestMp3()
            {
                Track = "10", Title = "A Small Victory", Year = year, BitRate = 192, Artist = artist, Album = album, AlbumArtist = artist
            });
            reader._albumTracks.Add(new TestMp3()
            {
                Track = "11", Title = "Crack Hitler", Year = "1991", BitRate = 320, Artist = "faith no more", Album = album, AlbumArtist = artist
            });
            reader._albumTracks.Add(new TestMp3()
            {
                Track = "12", Title = "Jizzlobber", Year = year, BitRate = 192, Artist = artist, Album = "Angel dust", AlbumArtist = artist
            });
            reader._albumTracks.Add(new TestMp3()
            {
                Track = "13", Title = "Midnight Cowboy", Year = year, BitRate = 192, Artist = artist, Album = album, AlbumArtist = artist
            });
            reader._albumTracks.Add(new TestMp3()
            {
                Track = "14", Title = "Easy", Year = "1993", BitRate = 192, Artist = "FAITH NO MORE", Album = album, AlbumArtist = artist
            });

            return(reader);
        }