public void BytesSyncTest(string path) { var data = File.ReadAllBytes(path); ICryptoGraph crypto = new CryptographAes(); var iv = crypto.GenerateIv(); var actual = crypto.Encrypt(data, iv, key); var decrypt = crypto.Decrypt(actual, iv, key); decrypt.Should().BeEquivalentTo(data); }
public void StringSyncTest(string path) { var text = File.ReadAllText(path); ICryptoGraph crypto = new CryptographAes(); var iv = crypto.GenerateIv(); var actual = crypto.Encrypt(text, iv, key); var decrypt = crypto.Decrypt(actual, iv, key); decrypt.Should().Be(text); }
public void BytesSyncTest(string path, string expected) { var data = File.ReadAllBytes(path); ICryptoGraph crypto = new CryptographAes(); var actual = crypto.Encrypt(data, iv, key); actual.Should().BeEquivalentTo(File.ReadAllBytes(expected)); var decrypt = crypto.Decrypt(actual, iv, key); decrypt.Should().BeEquivalentTo(data); }