public void FindPerformancesByArtistIdTest() { if (database == null) { database = new Database(TestUtils.ConnString); } Assert.NotNull(database); var performanceDao = new PerformanceDao(database); InsertDummyData(performanceDao); Assert.Equal(items.Count, performanceDao.Count()); var artistDao = new ArtistDao(database); var artists = artistDao.FindByName(ARTIST_NAME); Assert.NotNull(artists); Assert.NotEqual(0, artists.Count); IList<Performance> dbPerformance = performanceDao.FindByArtistId(artists[0].Id); Assert.NotNull(dbPerformance); Assert.Equal(items.Count, dbPerformance.Count); foreach (var performance in dbPerformance) { Assert.True(items.Contains(performance)); } }
public void FindArtistByNameTest() { if (database == null) { database = new Database(TestUtils.ConnString); } Assert.NotNull(database); var artistDao = new ArtistDao(database); InsertDummyData(artistDao); Assert.Equal(items.Count, artistDao.Count()); var artists = artistDao.FindByName(ARTIST1_NAME); Assert.NotNull(artists); Assert.Equal(1, artists.Count); }