Пример #1
0
        public void IsAlbumDeleted()
        {
            albumList = CDCatalogManager.GetAlbums();

            foreach (Album a in albumList)
            {
                Assert.IsFalse(a.AlbumTitle.Equals(testAlbum.AlbumTitle));
            }
        }
Пример #2
0
        public void DeleteAnAlbum()
        {
            bool result = false;

            albumList = CDCatalogManager.GetAlbums();

            foreach (Album a in albumList)
            {
                if (a.AlbumTitle == testAlbum.AlbumTitle)
                {
                    result = CDCatalogManager.DeleteAlbum(a);
                }
            }

            Assert.IsTrue(result);
        }
Пример #3
0
        public void CheckAlbums()
        {
            bool result = false;

            albumList = CDCatalogManager.GetAlbums();

            foreach (Album a in albumList)
            {
                if (a.AlbumTitle == testAlbum.AlbumTitle)
                {
                    result = true;
                }
            }

            Assert.IsNotEmpty(albumList);
            Assert.IsTrue(result);
        }
Пример #4
0
        public void EditAnAlbum()
        {
            bool result = false;

            albumList.Clear();
            albumList = CDCatalogManager.GetAlbums();
            foreach (Album a in albumList)
            {
                if (a.AlbumTitle == editedTestAlbum.AlbumTitle)
                {
                    a.AlbumTitle = "Fixed Album";
                    result       = CDCatalogManager.UpdateAlbum(a);
                }
            }

            Assert.IsNotEmpty(albumList);
            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);
        }