public void ClearStorage()
        {
            var tracks = modelService.ReadAllTracks();

            foreach (var track in tracks)
            {
                modelService.DeleteTrack(track.TrackReference);
            }
        }
        public void TearDown()
        {
            var allTracks = modelService.ReadAllTracks();

            foreach (var track in allTracks)
            {
                modelService.DeleteTrack(track.TrackReference);
            }
        }
Exemplo n.º 3
0
        private void DeleteAll()
        {
            var trackIds = modelService.GetTrackIds().ToList();
            int deleted  = 0;

            foreach (var id in trackIds)
            {
                modelService.DeleteTrack(id);
                OnTestRunnerEvent(OngoingActionEvent,
                                  new TestRunnerOngoingEventArgs
                {
                    Message = $"Deleted {Interlocked.Increment(ref deleted)} out of {trackIds.Count} tracks from storage"
                });
            }
        }
Exemplo n.º 4
0
 private void DeleteAll()
 {
     var tracks = modelService.ReadAllTracks();
     int deleted = 0;
     foreach (var track in tracks)
     {
         modelService.DeleteTrack(track.TrackReference);
         OnTestRunnerEvent(
             OngoingActionEvent,
             new TestRunnerOngoingEventArgs
                 {
                     Message = string.Format("Deleted {0} out of {1} tracks from storage", Interlocked.Increment(ref deleted), tracks.Count)
                 });
     }
 }
        public void DeleteTrackTest()
        {
            const int Threshold      = 5;
            TrackData track          = new TrackData("isrc", "artist", "title", "album", 1986, 200);
            var       trackReference = modelService.InsertTrack(track);
            var       hashData       = new HashData(GenericSignature, GenericHashBuckets);

            modelService.InsertHashDataForTrack(new[] { hashData }, trackReference);

            modelService.DeleteTrack(trackReference);

            var subFingerprints = modelService.ReadSubFingerprintDataByHashBucketsWithThreshold(GenericHashBuckets, Threshold);

            Assert.IsTrue(subFingerprints.Any() == false);
            TrackData actualTrack = modelService.ReadTrackByReference(trackReference);

            Assert.IsNull(actualTrack);
        }