public virtual void TestSchemaEncodeDecodeFidelity() { var schema = TimeSchema.Of(); var time = TimeSpan.FromMilliseconds(DateTimeHelper.CurrentUnixTimeMillis()); var encoded = schema.Encode(time); var decoded = schema.Decode(encoded); Assert.Equal(time, decoded); }
static Schema() { ByteSequence = new ByteSequenceSchema(); ByteArray = new ByteArraySchema(); String = StringSchema.UTF8; Boolean = new BooleanSchema(); Int8 = new ByteSchema(); Int16 = new ShortSchema(); Int32 = new IntegerSchema(); Int64 = new LongSchema(); Float = new FloatSchema(); TimeStamp = TimestampSchema.Timestamp; Date = TimestampSchema.Date; Time = new TimeSchema(); }