コード例 #1
0
        public void TryReadPaddedString_Should_Return_String_Without_Padding()
        {
            const string TestString   = "shoftee";
            string       paddedString = TestString.PadRight(13, '\0');

            var buffer = Encoding.UTF8.GetBytes(paddedString);
            var reader = new PacketReader(buffer);

            string result;

            reader.TryReadPaddedString(13, out result);
            result.Should().Be(TestString);
        }