예제 #1
0
        public void IsGenreDeleted()
        {
            genreList = CDCatalogManager.GetGenres();

            foreach (Genre g in genreList)
            {
                Assert.IsFalse(g.GenreName.Equals(testGenre.GenreName));
            }
        }
예제 #2
0
        public void DeleteAGenre()
        {
            bool result = false;

            genreList = CDCatalogManager.GetGenres();

            foreach (Genre g in genreList)
            {
                if (g.GenreName == testGenre.GenreName)
                {
                    result = CDCatalogManager.DeleteGenre(g);
                }
            }

            Assert.IsTrue(result);
        }
예제 #3
0
        public void CheckGenres()
        {
            bool result = false;

            genreList = CDCatalogManager.GetGenres();
            foreach (Genre g in genreList)
            {
                if (g.GenreName == testGenre.GenreName)
                {
                    result = true;
                }
            }

            Assert.IsNotEmpty(genreList);
            Assert.IsTrue(result);
        }
예제 #4
0
        public void EditAGenre()
        {
            bool result = false;

            genreList.Clear();
            genreList = CDCatalogManager.GetGenres();

            foreach (Genre g in genreList)
            {
                if (g.GenreName == editedTestGenre.GenreName)
                {
                    g.GenreName = "Fixed Genre";
                    result      = CDCatalogManager.UpdateGenre(g);
                }
            }

            Assert.IsNotEmpty(genreList);
            Assert.IsTrue(result);
        }
예제 #5
0
        public void TearDown()
        {
            songList = CDCatalogManager.GetSongs();
            foreach (Song s in songList)
            {
                if (s.SongTitle == "Foxed Song" || s.SongTitle == "Misspelled Snog")
                {
                    CDCatalogManager.DeleteSong(s);
                }
            }

            albumList = CDCatalogManager.GetAlbums();
            foreach (Album a in albumList)
            {
                if (a.AlbumTitle == "Fixed Album" || a.AlbumTitle == "Misspelled Ablum")
                {
                    CDCatalogManager.DeleteAlbum(a);
                }
            }

            artistList = CDCatalogManager.GetArtists();
            foreach (Artist a in artistList)
            {
                if (a.ArtistName == "Fixed Artist" || a.ArtistName == "Misspelled Test Atrist")
                {
                    CDCatalogManager.DeleteArtist(a);
                }
            }

            genreList = CDCatalogManager.GetGenres();
            foreach (Genre g in genreList)
            {
                if (g.GenreName == "Fixed Genre" || g.GenreName == "Misspelled Gerne")
                {
                    CDCatalogManager.DeleteGenre(g);
                }
            }
        }
예제 #6
0
        public void AddASong()
        {
            bool result = false;

            artistList = CDCatalogManager.GetArtists();
            albumList  = CDCatalogManager.GetAlbums();
            genreList  = CDCatalogManager.GetGenres();

            foreach (Artist a in artistList)
            {
                if (a.ArtistName == testArtist.ArtistName)
                {
                    testSong.ArtistID = a.ArtistID;
                }
            }

            foreach (Album a in albumList)
            {
                if (a.AlbumTitle == testAlbum.AlbumTitle)
                {
                    testSong.AlbumID = a.AlbumID;
                }
            }

            foreach (Genre g in genreList)
            {
                if (g.GenreName == testGenre.GenreName)
                {
                    testSong.GenreID = g.GenreID;
                }
            }

            result = CDCatalogManager.AddSong(testSong);

            Assert.IsTrue(result);
        }
예제 #7
0
        public void Initialize()
        {
            testArtist.ArtistName = "Test and the Artists";

            testGenre.GenreName = "Test Genre";

            testAlbum.AlbumTitle = "Songs to Test By";
            testAlbum.Year       = 1990;

            testSong.SongTitle   = "I'll Have a Blue Testmas Without You";
            testSong.TrackNumber = 1;
            testSong.TrackLength = 325;

            editedTestArtist.ArtistName = "Misspelled Test Atrist";
            CDCatalogManager.AddArtist(editedTestArtist);

            editedTestGenre.GenreName = "Misspelled Gerne";
            CDCatalogManager.AddGenre(editedTestGenre);

            editedTestAlbum.AlbumTitle = "Misspelled Ablum";
            artistList.Clear();
            artistList = CDCatalogManager.GetArtists();
            foreach (Artist a in artistList)
            {
                if (a.ArtistName == editedTestArtist.ArtistName)
                {
                    editedTestAlbum.ArtistID = a.ArtistID;
                }
            }
            CDCatalogManager.AddAlbum(editedTestAlbum);

            editedTestSong.SongTitle   = "Misspelled Snog";
            editedTestSong.TrackLength = 240;
            editedTestSong.TrackNumber = 1;
            foreach (Artist a in artistList)
            {
                if (a.ArtistName == editedTestArtist.ArtistName)
                {
                    editedTestSong.ArtistID = a.ArtistID;
                }
            }

            genreList.Clear();
            genreList = CDCatalogManager.GetGenres();
            foreach (Genre g in genreList)
            {
                if (g.GenreName == editedTestGenre.GenreName)
                {
                    editedTestSong.GenreID = g.GenreID;
                }
            }

            albumList.Clear();
            albumList = CDCatalogManager.GetAlbums();
            foreach (Album a in albumList)
            {
                if (a.AlbumTitle == editedTestAlbum.AlbumTitle)
                {
                    editedTestSong.AlbumID = a.AlbumID;
                }
            }
            CDCatalogManager.AddSong(editedTestSong);
        }