Setup solution

This commit is contained in:
Geoffroy BONNEVILLE
2019-07-25 16:39:43 +02:00
parent 81509be167
commit 1b2007e6dd
136 changed files with 35834 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
using ModernKeePassLib.Keys;
using ModernKeePassLib.Utility;
using Xunit;
namespace ModernKeePassLib.Test.Keys
{
public class KcpCustomKeyTests
{
static readonly byte[] testData =
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
[Fact]
public void TestConstruct()
{
var expectedHash = new byte[32]
{
0xAF, 0x55, 0x70, 0xF5, 0xA1, 0x81, 0x0B, 0x7A,
0xF7, 0x8C, 0xAF, 0x4B, 0xC7, 0x0A, 0x66, 0x0F,
0x0D, 0xF5, 0x1E, 0x42, 0xBA, 0xF9, 0x1D, 0x4D,
0xE5, 0xB2, 0x32, 0x8D, 0xE0, 0xE8, 0x3D, 0xFC
};
var key = new KcpCustomKey("test1", testData, false);
var keyData = key.KeyData.ReadData();
Assert.True(MemUtil.ArraysEqual(keyData, testData));
key = new KcpCustomKey("test2", testData, true);
keyData = key.KeyData.ReadData();
Assert.True(MemUtil.ArraysEqual(keyData, expectedHash));
}
}
}