コード例 #1
0
        public void AssertEncodesTo(decimal value, params byte[] expectedBytes)
        {
            RequiredDecimalStructure decimalStructure = new RequiredDecimalStructure();
            decimalStructure.Value = value;

            byte[] actualBytes = Pincher.Encode(decimalStructure);

            ArrayAssert.AreEqual(expectedBytes, actualBytes);
        }
コード例 #2
0
        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);
        }