Пример #1
0
        [InlineData("12345678901234567")]//17size-> Blank0 critical value
        public void Map_WriteFieldWithBlankLength_MultipleWritesOfInconsistentLength_IsCorrectly(object fieldValue)
        {
            var val = new _class2()
            {
                C = "123456789012345678"
            };                                                   //18size
            var buf = BssomSerializer.Serialize(val);

            var bsfm = new BssomFieldMarshaller(buf);

            var cOffset = bsfm.IndexOf("[" + nameof(_class2.C) + "]");

            bsfm.TryWrite(cOffset, fieldValue).IsTrue();
            bsfm.ReadValue <BssomValue>(cOffset).Is(BssomValue.Create(fieldValue));
        }
Пример #2
0
        public void Map_WriteFieldWithBlankLength_IsExtraLengthWriting_VariableTypeSize_IsCorrectly()
        {
            var val = new _class2()
            {
                C = "123456789"
            };
            var buf = BssomSerializer.Serialize(val);

            var bsfm = new BssomFieldMarshaller(buf);


            string C1 = "123";

            bsfm.TryWrite(bsfm.IndexOf("[" + nameof(_class2.C) + "]"), C1).IsTrue();

            var val3 = BssomSerializer.Deserialize <BssomMap>(buf);

            val3["C"].Is(BssomValue.Create(C1));
            bsfm.ReadValue <string>(bsfm.IndexOf("[" + nameof(_class2.C) + "]")).Is(C1);
        }