public void AssertEncodesTo(decimal value, params byte[] expectedBytes) { RequiredDecimalStructure decimalStructure = new RequiredDecimalStructure(); decimalStructure.Value = value; byte[] actualBytes = Pincher.Encode(decimalStructure); ArrayAssert.AreEqual(expectedBytes, actualBytes); }
public void AssertRoundTrip(decimal value) { RequiredDecimalStructure forEncoding = new RequiredDecimalStructure(); forEncoding.Value = value; byte[] bytes = Pincher.Encode(forEncoding); RequiredDecimalStructure fromDecoding = Pincher.Decode<RequiredDecimalStructure>(bytes); Assert.AreEqual(fromDecoding.Value, forEncoding.Value); }