public void SetUp() { fingerprintService = new Mock<IFingerprintService>(MockBehavior.Strict); audioService = new Mock<IAudioService>(MockBehavior.Strict); lshAlgorithm = new Mock<ILocalitySensitiveHashingAlgorithm>(MockBehavior.Strict); fingerprintCommandBuilder = new FingerprintCommandBuilder(fingerprintService.Object, lshAlgorithm.Object); }
public void ShouldCreateExactlyTheSameFingerprints() { var fcb0 = new FingerprintCommandBuilder( new FingerprintService( new SpectrumService(new LomontFFT()), new StandardHaarWaveletDecomposition(), new FingerprintDescriptor(), new AudioSamplesNormalizer()), new LocalitySensitiveHashingAlgorithm( new MinHashService(new DefaultPermutations()), new HashConverter())); var fcb1 = new FingerprintCommandBuilder( new FingerprintService( new SpectrumService(new LomontFFT()), new StandardHaarWaveletDecomposition(), new FastFingerprintDescriptor(), new AudioSamplesNormalizer()), new LocalitySensitiveHashingAlgorithm( new MinHashService(new DefaultPermutations()), new HashConverter())); var fingerprints0 = fcb0.BuildFingerprintCommand() .From(GetAudioSamples()) .UsingServices(new NAudioService()) .Hash() .Result; fingerprints0.Sort( (fingerprint, hashedFingerprint) => fingerprint.SequenceNumber.CompareTo(hashedFingerprint.SequenceNumber)); var fingerprints1 = fcb1.BuildFingerprintCommand() .From(GetAudioSamples()) .UsingServices(new NAudioService()) .Hash() .Result; fingerprints1.Sort( (fingerprint, hashedFingerprint) => fingerprint.SequenceNumber.CompareTo(hashedFingerprint.SequenceNumber)); for (int i = 0; i < fingerprints0.Count; ++i) { CollectionAssert.AreEqual(fingerprints0[i].SubFingerprint, fingerprints1[i].SubFingerprint); } }
public void ResolveDefaultInterfacesForFingerprintCommandTest() { IFingerprintCommandBuilder fingerprintCommandBuilder = new FingerprintCommandBuilder(); Assert.IsNotNull(fingerprintCommandBuilder); }