public void MachineId_WithSerialAndProductId_GeneratesCorrectHashForDefaultSalt() { // 53929 => hex D2A9 var machineId = new MachineId(53929, "12345-99-1234"); // hash of 0000D2A912345991234GQ461qpa6s0SeD4qabZce6JVP7sTywtN Assert.AreEqual("47154b69a68069bdb601e048b74ba63e0595b22a", machineId.CaclculateMachineHash()); }
public void MachineId_WithSerialAndProductId_GeneratesCorrectHashForGivenSalt() { // 53929 => hex D2A9 var machineId = new MachineId(53929, "12345-99-1234"); // hash of 0000D2A912345991234salt Assert.AreEqual("db5bc63c9dda4552c3cd8e791213918b944d1718", machineId.CaclculateMachineHash("salt")); }
public void CalculateHash_WithNullSalt_ThrowsArgumentException() { var machineId = new MachineId(12345, "abcdef"); Assert.Throws <ArgumentException>(() => machineId.CaclculateMachineHash(null)); }