public void FromBytes_ConvertBytesToAgreement_Pass() { ECDiffieHellmanAgreement agreement = new ECDiffieHellmanAgreement(); byte[] agreementBytes = agreement.ToBytes(); // Send bytes over network ECDiffieHellmanAgreement remoteAgreement = ECDiffieHellmanAgreement.FromBytes(agreementBytes); Assert.IsNotNull(remoteAgreement); }
public void ToBytes_ConvertAgreementToBytes_Pass() { ECDiffieHellmanAgreement agreement = new ECDiffieHellmanAgreement(); byte[] agreementBytes = agreement.ToBytes(); byte[] agreementNativeBytes; BinaryFormatter formatter = new BinaryFormatter(); using (var ms = new MemoryStream()) { formatter.Serialize(ms, agreement); agreementNativeBytes = ms.ToArray(); } CollectionAssert.AreEqual(agreementBytes, agreementNativeBytes); }