public async Task TestGetPairwiseWorksWhenNoMetadataIsPresent() { await Pairwise.CreateAsync(wallet, theirDid, myDid, null); var pairwiseInfoJson = await Pairwise.GetAsync(wallet, theirDid); var pairwiseInfo = JObject.Parse(pairwiseInfoJson); Assert.AreEqual(myDid, pairwiseInfo.Value <string>("my_did")); Assert.IsNull(pairwiseInfo["metadata"]); }
public async Task TestGetPairwiseWorks() { await Pairwise.CreateAsync(wallet, theirDid, myDid, METADATA); var pairwiseInfoJson = await Pairwise.GetAsync(wallet, theirDid); var pairwiseInfo = JObject.Parse(pairwiseInfoJson); Assert.AreEqual(myDid, pairwiseInfo.Value <string>("my_did")); Assert.AreEqual(METADATA, pairwiseInfo.Value <string>("metadata")); }
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 TestGetPairwiseWorksForNotCreated() { var ex = await Assert.ThrowsExceptionAsync <WalletValueNotFoundException>(() => Pairwise.GetAsync(wallet, theirDid) ); }
public async Task TestGetPairwiseWalletItemNotFoundExceptionForNotCreated() { var ex = await Assert.ThrowsExceptionAsync <WalletItemNotFoundException>(() => Pairwise.GetAsync(wallet, theirVerkey) ); }