Ejemplo n.º 1
0
        public void AppendShort_CorrectResult([Values(
                                                   short.MinValue, -10000, -9999, -1000, -999, -100, -99, -10, -9, -1,
                                                   0, 1, 9, 10, 99, 100, 999, 1000, 9999, 10000, short.MaxValue)] short value)
        {
            // arrange
            _builder.Clear();

            // act
            _builder.Append(value);

            // assert
            var bytes = _builder.AsSpan();

            Assert.That(Encoding.UTF8.GetString(bytes), Is.EqualTo(value.ToString()));
        }
Ejemplo n.º 2
0
        public void AppendShort_CorrectResult()
        {
            // arrange
            _builder.Clear();
            var guid = Guid.Parse("01234567-89AB-CDEF-0123-456789ABCEF0");

            // act
            _builder.Append(guid);

            // assert
            var bytes = _builder.AsSpan();

            Assert.That(Encoding.UTF8.GetString(bytes), Is.EqualTo(guid.ToString()));
        }