public void ShouldReadFingerprintsFromStorage()
        {
            const int NumberOfFingerprints = 100;
            var       trackReference       = InsertTrack();

            bool[] genericFingerprint = GenericFingerprint();
            for (int i = 0; i < NumberOfFingerprints; i++)
            {
                fingerprintDao.InsertFingerprint(new FingerprintData(genericFingerprint, trackReference));
            }

            var fingerprints = fingerprintDao.ReadFingerprintsByTrackReference(trackReference);

            Assert.AreEqual(NumberOfFingerprints, fingerprints.Count);
            foreach (var fingerprint in fingerprints)
            {
                CollectionAssert.AreEqual(genericFingerprint, fingerprint.Signature);
            }
        }
        public void ReadFingerprintsTest()
        {
            const int NumberOfFingerprints = 100;
            TrackData track          = new TrackData("isrc", "artist", "title", "album", 1986, 200);
            var       trackReference = trackDao.InsertTrack(track);

            for (int i = 0; i < NumberOfFingerprints; i++)
            {
                fingerprintDao.InsertFingerprint(new FingerprintData(GenericFingerprint, trackReference));
            }

            var fingerprints = fingerprintDao.ReadFingerprintsByTrackReference(trackReference);

            Assert.IsTrue(fingerprints.Count == NumberOfFingerprints);

            foreach (var fingerprint in fingerprints)
            {
                CollectionAssert.AreEqual(GenericFingerprint, fingerprint.Signature);
            }
        }
Exemple #3
0
 public IList <FingerprintData> ReadFingerprintsByTrackReference(IModelReference trackReference)
 {
     return(fingerprintDao.ReadFingerprintsByTrackReference(trackReference));
 }