Ejemplo n.º 1
0
        public int Size(ref BssomSizeContext context, string value)
        {
            if (value == null)
            {
                return(BssomBinaryPrimitives.NullSize);
            }

            return(BssomBinaryPrimitives.StringSize(value) + BssomBinaryPrimitives.BuildInTypeCodeSize);
        }
Ejemplo n.º 2
0
 public void StringFormatter_Formatter_IsCorrectly()
 {
     for (int i = 0; i < 10; i++)
     {
         var value = RandomHelper.RandomValue <string>();
         int size  = BssomBinaryPrimitives.BuildInTypeCodeSize + BssomBinaryPrimitives.StringSize(value);
         VerifyHelper.VerifySimpleType(value, size);
     }
     {
         int size = BssomBinaryPrimitives.BuildInTypeCodeSize + BssomBinaryPrimitives.StringSize(string.Empty);
         VerifyHelper.VerifySimpleType(string.Empty, size);
     }
 }