public async Task ValidateEncryptDecryptDocument() { TestDoc testDoc = TestDoc.Create(); JObject encryptedDoc = await LegacyEncryptionProcessorTests.VerifyEncryptionSucceeded(testDoc); (JObject decryptedDoc, DecryptionContext decryptionContext) = await EncryptionProcessor.DecryptAsync( encryptedDoc, LegacyEncryptionProcessorTests.mockEncryptor.Object, new CosmosDiagnosticsContext(), CancellationToken.None); LegacyEncryptionProcessorTests.VerifyDecryptionSucceeded( decryptedDoc, testDoc, decryptionContext); }
public async Task EncryptDecryptPropertyWithNullValue() { TestDoc testDoc = TestDoc.Create(); testDoc.SensitiveStr = null; JObject encryptedDoc = await LegacyEncryptionProcessorTests.VerifyEncryptionSucceeded(testDoc); (JObject decryptedDoc, DecryptionContext decryptionContext) = await EncryptionProcessor.DecryptAsync( encryptedDoc, LegacyEncryptionProcessorTests.mockEncryptor.Object, new CosmosDiagnosticsContext(), CancellationToken.None); LegacyEncryptionProcessorTests.VerifyDecryptionSucceeded( decryptedDoc, testDoc, decryptionContext); }