예제 #1
0
        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));
            }
        }
예제 #2
0
        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);
        }
예제 #3
0
 public virtual IList <TrackData> ReadAllTracks()
 {
     return(trackDao.ReadAll());
 }