コード例 #1
0
ファイル: AESDecryptTest.cs プロジェクト: poweryang1990/Snow
        public void when_key_is_invalid_should_throw_ArgumentException()
        {
            var clearByte = new byte[] { 1 };
            var key       = new byte[] { 1, 2 };

            Assert.Throws <ArgumentException>(() => clearByte.AESEncrypt(key));
        }
コード例 #2
0
ファイル: AESEncryptTest.cs プロジェクト: poweryang1990/Snow
        public void when_key_is_null_should_throw_ArgumentNullException()
        {
            var clearBytes = new byte[] { 1 };
            var key        = (byte[])null;

            // ReSharper disable once ExpressionIsAlwaysNull
            Assert.Throws <ArgumentNullException>(() => clearBytes.AESEncrypt(key));
        }