public void SameNumberOfHashBinsIsInsertedInAllTablesWhenFingerprintingEntireSongTest()
        {
            const int StaticStride   = 5115;
            TagInfo   tagInfo        = tagService.GetTagInfo(PathToMp3);
            int       releaseYear    = tagInfo.Year;
            TrackData track          = new TrackData(tagInfo.ISRC, tagInfo.Artist, tagInfo.Title, tagInfo.Album, releaseYear, (int)tagInfo.Duration);
            var       trackReference = TrackDao.InsertTrack(track);
            var       hashData       = fingerprintCommandBuilder
                                       .BuildFingerprintCommand()
                                       .From(PathToMp3)
                                       .WithFingerprintConfig(config =>
            {
                config.Stride = new IncrementalStaticStride(StaticStride, config.SamplesPerFingerprint);
            })
                                       .UsingServices(audioService)
                                       .Hash()
                                       .Result;

            InsertHashDataForTrack(hashData, trackReference);

            var hashes = HashBinDao.ReadHashDataByTrackReference(track.TrackReference);

            Assert.AreEqual(hashData.Count, hashes.Count);
            foreach (var data in hashes)
            {
                Assert.AreEqual(25, data.HashBins.Length);
            }
        }
        public void InsertReadTest()
        {
            TrackData track            = new TrackData("isrc", "artist", "title", "album", 1986, 200);
            var       trackReference   = TrackDao.InsertTrack(track);
            const int NumberOfHashBins = 100;
            var       hashData         = Enumerable.Range(0, NumberOfHashBins).Select(i => new HashData(GenericSignature, GenericHashBuckets));

            InsertHashDataForTrack(hashData, trackReference);

            var hashDatas = HashBinDao.ReadHashDataByTrackReference(track.TrackReference);

            Assert.AreEqual(NumberOfHashBins, hashDatas.Count);
        }
        public void ReadHashDataByTrackTest()
        {
            TrackData firstTrack = new TrackData("isrc", "artist", "title", "album", 2012, 200);

            var firstTrackReference = TrackDao.InsertTrack(firstTrack);

            var firstHashData = fingerprintCommandBuilder
                                .BuildFingerprintCommand()
                                .From(PathToMp3, 10, 0)
                                .WithDefaultFingerprintConfig()
                                .UsingServices(audioService)
                                .Hash()
                                .Result;

            InsertHashDataForTrack(firstHashData, firstTrackReference);

            TrackData secondTrack = new TrackData("isrc", "artist", "title", "album", 2012, 200);

            var secondTrackReference = TrackDao.InsertTrack(secondTrack);

            var secondHashData = fingerprintCommandBuilder
                                 .BuildFingerprintCommand()
                                 .From(PathToMp3, 20, 10)
                                 .WithDefaultFingerprintConfig()
                                 .UsingServices(audioService)
                                 .Hash()
                                 .Result;

            InsertHashDataForTrack(secondHashData, secondTrackReference);

            var resultFirstHashData = HashBinDao.ReadHashDataByTrackReference(firstTrackReference);

            AssertHashDatasAreTheSame(firstHashData, resultFirstHashData);

            IList <HashData> resultSecondHashData = HashBinDao.ReadHashDataByTrackReference(secondTrackReference);

            AssertHashDatasAreTheSame(secondHashData, resultSecondHashData);
        }