public virtual void TestSchemaDecode() { var byteData = new byte[] { 24, 42 }; short?expected = 24 * 256 + 42; var schema = ShortSchema.Of(); Assert.Equal(expected, schema.Decode(byteData)); }
public virtual void TestSchemaEncodeDecodeFidelity() { var schema = ShortSchema.Of(); short start = 3440; for (short i = 0; i < 100; ++i) { var encode = schema.Encode((short)(start + i)); int decoded = schema.Decode(encode); Assert.Equal(decoded, start + i); } }