public void AddAGenre() { bool result = false; result = CDCatalogManager.AddGenre(testGenre); Assert.IsTrue(result); }
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); }