public void VerifyDecryption_GenericDecryptionFailed_ThrowsGpgError() { var verifier = new GpgResultVerifier(); var result = new GpgResultBuilder() .WithStatusMessage(GpgStatusCode.DECRYPTION_FAILED, null) .Build(); Should.Throw <GpgError>(() => verifier.VerifyDecryption(result)); }
public void VerifyDecryption_GenericFailure_ThrowsGpgException() { var verifier = new GpgResultVerifier(); var result = new GpgResultBuilder() .WithStatusMessage(GpgStatusCode.FAILURE, null) .Build(); Should.Throw <GpgException>(() => verifier.VerifyDecryption(result)); }
public void VerifyDecryption_NonZeroExitCode_ThrowsGpgException(int exitCode) { var verifier = new GpgResultVerifier(); var result = new GpgResultBuilder() .WithExitCode(exitCode) .Build(); Should.Throw <GpgException>(() => verifier.VerifyDecryption(result)); }
public void VerifyEncryption_ZeroExitCode_DoesNotThrow() { var verifier = new GpgResultVerifier(); var result = new GpgResultBuilder() .WithExitCode(0) .Build(); Should.NotThrow(() => verifier.VerifyEncryption(result)); }
public void VerifyDecryption_DecryptionStatusOkay_DoesNotThrow() { var verifier = new GpgResultVerifier(); var result = new GpgResultBuilder() .WithStatusMessage(GpgStatusCode.DECRYPTION_OKAY, null) .WithStatusMessage(GpgStatusCode.END_DECRYPTION, null) .Build(); Should.NotThrow(() => verifier.VerifyDecryption(result)); }
public void VerifyDecryption_NoData_ThrowsGpgError() { var verifier = new GpgResultVerifier(); var result = new GpgResultBuilder() .WithStatusMessage(GpgStatusCode.FAILURE, null) .WithStatusMessage(GpgStatusCode.NODATA, null) .Build(); Should.Throw <GpgError>(() => verifier.VerifyDecryption(result)); }
public void VerifyEncryption_InvalidRecipient_ThrowsGpgError() { var verifier = new GpgResultVerifier(); var result = new GpgResultBuilder() .WithStatusMessage(GpgStatusCode.FAILURE) .WithStatusMessage(GpgStatusCode.INV_RECP, "rcp_a rcp_b") .Build(); Should.Throw <GpgError>(() => verifier.VerifyEncryption(result)); }
public void VerifyEncryption_KeyExpired_ThrowsGpgError() { var verifier = new GpgResultVerifier(); var result = new GpgResultBuilder() .WithStatusMessage(GpgStatusCode.FAILURE) .WithStatusMessage(GpgStatusCode.INV_RECP, "rcp_a rcp_b") .WithStatusMessage(GpgStatusCode.KEYEXPIRED) .Build(); var error = Should.Throw <GpgError>(() => verifier.VerifyEncryption(result)); }