Ejemplo n.º 1
0
        public void InsertTest()
        {
            TrackData track          = new TrackData("artist", "title", "album", 1986, 200);
            var       trackReference = TrackDao.InsertTrack(track);

            var fingerprintReference = FingerprintDao.InsertFingerprint(new FingerprintData(GenericFingerprint, trackReference));

            AssertModelReferenceIsInitialized(fingerprintReference);
        }
Ejemplo n.º 2
0
        public void MultipleFingerprintsInsertTest()
        {
            const int NumberOfFingerprints = 100;

            for (int i = 0; i < NumberOfFingerprints; i++)
            {
                var trackData            = new TrackData("artist", "title", "album", 2012, 200);
                var trackReference       = TrackDao.InsertTrack(trackData);
                var fingerprintReference = FingerprintDao.InsertFingerprint(new FingerprintData(GenericFingerprint, trackReference));

                AssertModelReferenceIsInitialized(fingerprintReference);
            }
        }
Ejemplo n.º 3
0
        public void ReadTest()
        {
            const int NumberOfFingerprints = 100;
            TrackData track          = new TrackData("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)
            {
                Assert.IsTrue(GenericFingerprint.Length == fingerprint.Signature.Length);
                for (var i = 0; i < GenericFingerprint.Length; i++)
                {
                    Assert.AreEqual(GenericFingerprint[i], fingerprint.Signature[i]);
                }
            }
        }