Ejemplo n.º 1
0
        public void WriteSingleDecimal(string format)
        {
            var val = decimal.Parse(format, System.Globalization.CultureInfo.InvariantCulture);

            Console.WriteLine(val);

            using (var writer = new ManagedBinaryWriter(_memoryStream, Symbols.EmptySymbolTablesArray))
            {
                writer.WriteDecimal(val);
                writer.Flush();
                var bytes = _memoryStream.GetWrittenBuffer();
                Assert.AreEqual(val, ReadUtils.Binary.ReadSingleDecimal(bytes).ToDecimal());
            }
        }
Ejemplo n.º 2
0
        public void WriteSingleDecimal(string format)
        {
            var val = decimal.Parse(format);

            Console.WriteLine(val);

            using (var writer = new ManagedBinaryWriter(BinaryConstants.EmptySymbolTablesArray))
            {
                writer.WriteDecimal(val);
                byte[] bytes = null;
                writer.Flush(ref bytes);
                Assert.AreEqual(val, ReadUtils.Binary.ReadSingleDecimal(bytes));
            }
        }