public void Sign_Should_Throw_Exception_When_PrivateKey_Is_Null() { var publicKey = ECDsa.Create(); var alg = new ES256Algorithm(publicKey); var bytesToSign = Array.Empty <byte>(); Action action = () => alg.Sign(null, bytesToSign); action.Should() .Throw <InvalidOperationException>("because asymmetric algorithm cannot sign data without private key"); }