예제 #1
0
        public void ToStringB(byte[] correctBytes)
        {
            var uuid           = new Uuid(correctBytes);
            var expectedString = UuidTestsUtils.GetStringB(correctBytes);

            var actualString = uuid.ToString("B");

            Assert.AreEqual(expectedString, actualString);
        }
        public void TryFormatBCorrect(byte[] correctBytes)
        {
            var         uuid           = new Uuid(correctBytes);
            var         expectedString = UuidTestsUtils.GetStringB(correctBytes);
            Span <char> buffer         = stackalloc char[38];

            Assert.True(uuid.TryFormat(buffer, out int charsWritten, new ReadOnlySpan <char>(new[] { 'B' })));
            Assert.AreEqual(38, charsWritten);
            Assert.AreEqual(expectedString, new string(buffer));
        }