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());
        }
Ejemplo n.º 2
0
 public void WritePacket(PacketWriter writer)
 {
     writer.WriteInt32((int)FailureReason);
     if (Fingerprint != null)
     {
         writer.WriteString(Fingerprint.ToJson());
     }
     writer.WriteString(HostName);
     writer.WriteString(RackcdnUrl);
     writer.WriteString(iTunesUrl);
     writer.WriteString(Unknown1);
     writer.WriteString(Unknown2);
     writer.WriteByte(Unknown3);
     writer.WriteByteArray(CompressedFingerprintJson);
     writer.WriteString(Unknown4);
 }
Ejemplo n.º 3
0
 public void WritePacket(PacketWriter writer)
 {
     writer.WriteInt32((int)FailureReason);
     if (Fingerprint != null)
     {
         writer.WriteString(Fingerprint.ToJson());
     }
     else
     {
         writer.WriteString(null);
     }
     writer.WriteString(HostName);
     writer.WriteString(AssetsRootUrl);
     writer.WriteString(iTunesUrl);
     writer.WriteString(Unknown1);
     writer.WriteInt32(RemainingTime);
     writer.WriteByte(Unknown2);
     writer.WriteByteArray(CompressedFingerprintJson);
     writer.WriteString(Unknown3);
     writer.WriteString(Unknown4);
     File.WriteAllBytes("dump", ((MemoryStream)writer.BaseStream).ToArray());
 }