public void TestRequestIdFunctionality() { AcspRequestId testId; testId = new AcspRequestId(); Assert.AreEqual((UInt32)1, testId.RequestId); testId = new AcspRequestId(); Assert.AreEqual((UInt32)2, testId.RequestId); Assert.AreEqual(0x02, testId.IdArray[3]); // Making sure the conversion to big-endian is working correctly testId.UpdateId(); Assert.AreEqual((UInt32)3, testId.RequestId); }
public void TestRequestIdConstructorByByteArray() { Byte[] testArray = new Byte[4]; // Creating 4-byte (big-endian) representation of 6000 testArray[3] = 0x70; // 112 decimal testArray[2] = 0x17; // 23 x 256 = 5888 testArray[1] = 0x00; testArray[0] = 0x00; AcspRequestId testId = new AcspRequestId(testArray); Assert.AreEqual((UInt32)6000, testId.RequestId); Assert.AreEqual(0x70, testId.IdArray[3]); // checking to make sure that the encoded array is back to big-endian }