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); }
[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")); }
[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"]); }
public async Task TestSetPairwiseMetadataWorksForNotCreatedPairwise() { var ex = await Assert.ThrowsExceptionAsync <WalletItemNotFoundException>(() => Pairwise.SetMetadataAsync(wallet, theirVerkey, METADATA) ); }