public BigImageInfo Read(IMsgPackReader reader)
        {
            var imageInfo = new BigImageInfo();
            var nullable  = reader.ReadMapLength();

            if (!nullable.HasValue)
            {
                return(null);
            }
            for (var index = 0; index < nullable.Value; ++index)
            {
                var str = _stringConverter.Value.Read(reader);
                if (ReadImageInfoBody(str, imageInfo, reader))
                {
                    continue;
                }

                if (str == "Size2")
                {
                    imageInfo.Size = _intConverter.Value.Read(reader);
                }
                else
                {
                    reader.SkipToken();
                }
            }

            return(imageInfo);
        }
        public void WriteSmoke(ContextFixtureBase fixture)
        {
            var testObject = new BigImageInfo
            {
                Credits = Guid.NewGuid().ToString("N"),
                Height  = 123,
                Link    = Guid.NewGuid().ToString("N"),
                Size    = 234,
                Width   = 345
            };

            MsgPackSerializer.Serialize(testObject, fixture.NewContext).ShouldBe(MsgPackSerializer.Serialize(testObject, fixture.OldContext));
        }
Esempio n. 3
0
        public void Write(BigImageInfo value, IMsgPackWriter writer)
        {
            if (value == null)
            {
                writer.Write(DataTypes.Null);
            }
            else
            {
                writer.WriteArrayHeader(6U);

                WriteImageInfoBody(value, writer);
                _intConverter.Value.Write(value.Size, writer);
            }
        }
        public void Write(BigImageInfo value, IMsgPackWriter writer)
        {
            if (value == null)
            {
                writer.Write(DataTypes.Null);
            }
            else
            {
                writer.WriteMapHeader(5U);

                _stringConverter.Value.Write("Size2", writer);
                _intConverter.Value.Write(value.Size, writer);

                WriteImageInfoBody(value, writer);
            }
        }