Ejemplo n.º 1
0
        public void TestIfFloatCanBeSerializedJsonLz4()
        {
            // Arrange
            var value = 0.1f;

            // Act
            var json           = lz4Serializer.SerializeToJson(value);
            var sequence       = new Sequence <byte>();
            var sequenceWriter = new MessagePackWriter(sequence);

            lz4Serializer.ConvertFromJson(json, ref sequenceWriter);
            sequenceWriter.Flush();
            var deserialized = lz4Serializer.Deserialize <float>(sequence.AsReadOnlySequence);

            // Assert
            Assert.Equal(value, deserialized);
        }