public void XTeaEncrypt() { var encryptedMessage = XTea .Encrypt(_message, _key.AsSpan().AsBytes()) .ToArray(); Assert.Equal( expected: _encryptedMessage, actual: encryptedMessage); }
public void Encrypt_IncorrectKeySize( [Range(from: 0, to: 32)] int keyLength ) { Assume.That(keyLength != XTea.KeySizeInBytes); var message = new byte[MinimumMessageSize]; var key = new byte[keyLength]; Assert.Throws <ArgumentException>( () => XTea.Encrypt( message: message, key: key) ); }