public void UnpackPackedMessageWithMultipleRecipientsSucceeds() { ICrypto crypto = IndyDotNet.Crypto.Factory.GetCrypto(_wallet); List <IDid> recipients = new List <IDid>(); IdentitySeed seed = new IdentitySeed() { Seed = "00000000000000000000000000000My2" }; recipients.Add(IndyDotNet.Did.Factory.CreateMyDid(_pool, _wallet, seed)); seed = new IdentitySeed() { Seed = "00000000000000000000000000000My3" }; recipients.Add(IndyDotNet.Did.Factory.CreateMyDid(_pool, _wallet, seed)); PackedMessage packedMessage = crypto.PackMessage(recipients, _senderDid, MESSAGE_TO_SEND); UnpackedMessage unpackedMessage = crypto.UnpackMessage(packedMessage); Assert.IsNotNull(unpackedMessage, $"did not get back an unpacked message"); Assert.AreEqual(MESSAGE_TO_SEND, unpackedMessage.Message, "unpacked message is not the same as what was sent"); }
public void PackMessageSucceeds() { ICrypto crypto = IndyDotNet.Crypto.Factory.GetCrypto(_wallet); PackedMessage packedMessage = crypto.PackMessage(_senderDid, _senderDid, MESSAGE_TO_SEND); Assert.IsNotNull(packedMessage, "crypto.PackMessage failed to return PackMessage instance"); }
public void UnpackPackedMessageSucceeds() { ICrypto crypto = IndyDotNet.Crypto.Factory.GetCrypto(_wallet); PackedMessage packedMessage = crypto.PackMessage(_senderDid, _senderDid, MESSAGE_TO_SEND); UnpackedMessage unpackedMessage = crypto.UnpackMessage(packedMessage); Assert.IsNotNull(unpackedMessage, $"did not get back an unpacked message"); Assert.AreEqual(MESSAGE_TO_SEND, unpackedMessage.Message, "unpacked message is not the same as what was sent"); }
public void PackMessageToTwoRecipientsSucceeds() { IdentitySeed seed = new IdentitySeed() { Seed = "00000000000000000000000000000My2" }; ICrypto crypto = IndyDotNet.Crypto.Factory.GetCrypto(_wallet); List <IDid> recipients = new List <IDid>(); recipients.Add(_senderDid); recipients.Add(IndyDotNet.Did.Factory.CreateMyDid(_pool, _wallet, seed)); PackedMessage packedMessage = crypto.PackMessage(recipients, _senderDid, MESSAGE_TO_SEND); Assert.IsNotNull(packedMessage, "crypto.PackMessage failed to return PackMessage instance"); }