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); }
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); } }
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]); } } }