public void ReadAllTracksTest() { const int TrackCount = 5; var expectedTracks = InsertTracks(TrackCount); var tracks = trackDao.ReadAll(); Assert.AreEqual(TrackCount, tracks.Count); foreach (var expectedTrack in expectedTracks) { Assert.IsTrue(tracks.Any(track => track.ISRC == expectedTrack.ISRC)); } }
public void MultipleTrackInsertTest() { const int NumberOfTracks = 1000; var modelReferences = new ConcurrentBag <IModelReference>(); for (int i = 0; i < NumberOfTracks; i++) { var modelReference = trackDao.InsertTrack(new TrackData("isrc", "artist", "title", "album", 2012, 200)); Assert.IsFalse(modelReferences.Contains(modelReference)); modelReferences.Add(modelReference); } Assert.AreEqual(NumberOfTracks, trackDao.ReadAll().Count); }
public virtual IList <TrackData> ReadAllTracks() { return(trackDao.ReadAll()); }