Esempio n. 1
0
        public async Task TestSetPairwiseMetadataWorks()
        {
            await Pairwise.CreateAsync(wallet, theirDid, myDid, null);

            var pairwiseWithoutMetadata = await Pairwise.GetAsync(wallet, theirDid);

            await Pairwise.SetMetadataAsync(wallet, theirDid, METADATA);

            var pairwiseWithMetadata = await Pairwise.GetAsync(wallet, theirDid);

            Assert.AreNotEqual(pairwiseWithoutMetadata, pairwiseWithMetadata);
            Assert.AreEqual(string.Format(PAIRWISE_TEMPLATE, myDid, METADATA), pairwiseWithMetadata);
        }
Esempio n. 2
0
        [Ignore] //Bug in SDK?
        public async Task TestSetPairwiseMetadataWorksWithEmptyString()
        {
            await Pairwise.CreateAsync(wallet, theirDid, myDid, METADATA);

            var pairwiseWithMetadata = await Pairwise.GetAsync(wallet, theirDid);

            await Pairwise.SetMetadataAsync(wallet, theirDid, string.Empty);

            var pairwiseWithoutMetadata = await Pairwise.GetAsync(wallet, theirDid);

            var pairwiseInfo = JObject.Parse(pairwiseWithoutMetadata);

            Assert.AreNotEqual(pairwiseWithoutMetadata, pairwiseWithMetadata);
            Assert.AreEqual(string.Empty, pairwiseInfo.Value <string>("metadata"));
        }
Esempio n. 3
0
        [Ignore] //Bug in SDK?
        public async Task TestSetPairwiseMetadataWorksWithNull()
        {
            await Pairwise.CreateAsync(wallet, theirDid, myDid, METADATA);

            var pairwiseWithMetadata = await Pairwise.GetAsync(wallet, theirDid);

            await Pairwise.SetMetadataAsync(wallet, theirDid, null);

            var pairwiseWithoutMetadata = await Pairwise.GetAsync(wallet, theirDid);

            var pairwiseInfo = JObject.Parse(pairwiseWithoutMetadata);

            Assert.AreNotEqual(pairwiseWithoutMetadata, pairwiseWithMetadata);
            Assert.IsNull(pairwiseInfo["metadata"]);
        }
Esempio n. 4
0
 public async Task TestSetPairwiseMetadataWorksForNotCreatedPairwise()
 {
     var ex = await Assert.ThrowsExceptionAsync <WalletItemNotFoundException>(() =>
                                                                              Pairwise.SetMetadataAsync(wallet, theirVerkey, METADATA)
                                                                              );
 }