Beispiel #1
0
        public void ConstructorChecksParameters()
        {
            var validHashSize   = 256;
            var invalidHashSize = 254;

            Assert.Throws <ArgumentException>(() => new netMIH.Index(invalidHashSize),
                                              "Argument exception not thrown for invalid hash size");
            var x = new netMIH.Index(validHashSize);

            Assert.Pass("Valid hash size didn't result in exception");

            x = new netMIH.Index(Index.Configuration.PDQ);
            Assert.True(x.HashSize == 256, $"Test failed. Anticipated hashsize of 256. Received {x.HashSize} ");
            Assert.True(x.MatchThreshold == 32,
                        $"Test failed. Anticipated threshold of 32. received {x.MatchThreshold}");
            Assert.True(x.WindowSize == 2,
                        $"Test failed. Anticipated window size of 2 (MatchThreshold/WordSize). Received {x.WindowSize}");
            Assert.True(x.WordLength == 16, $"Test failed. Anticipated word length of 16. Received {x.WordLength}");
        }
Beispiel #2
0
 /// <summary>
 /// Default constructor
 /// </summary>
 /// <param name="index">netMIH index (provided via dependency injection</param>
 /// <param name="wrapper">PDQWrapper (provided via dependency injection</param>
 public PDQController(netMIH.Index index, PDQWrapper wrapper)
 {
     this._index   = index;
     this._wrapper = wrapper;
 }