public void FromJson_ValidArgs()
        {
            var json        = File.ReadAllText(_fingerprintPath);
            var fingerprint = Fingerprint.FromJson(json);

            Assert.AreEqual(681, fingerprint.Count, "Did not fully read the fingerprint file.");
            Assert.AreEqual("9d075b9546211da641d06f4c576aa9b9c62212fb", fingerprint.MasterHash);
            Assert.AreEqual("8.116.5", fingerprint.Version);
        }
        public void ToJson_Equality()
        {
            // Original fingerprint.
            var oriFingerprint = new Fingerprint(_fingerprintPath);

            // Turn the Original fingerprint into a JSON string.
            var oriJson = oriFingerprint.ToJson();

            // Create a new Fingerprint object from the oriFingerprint.ToJson() string.
            var newFingerprint = Fingerprint.FromJson(oriJson);

            Assert.AreEqual(oriFingerprint.ComputeMasterHash(), newFingerprint.ComputeMasterHash());
        }
 public void FromJson_InvalidArgs_Exception()
 {
     Assert.Throws <ArgumentNullException>(() => Fingerprint.FromJson(null));
     Assert.Throws <ArgumentNullException>(() => Fingerprint.FromJson(string.Empty));
     Assert.Throws <ArgumentNullException>(() => Fingerprint.FromJson("   "));
 }