Exemple #1
0
        public void ToHex_FromHex_Roundtrips_UriSafe(string input)
        {
            byte[] data    = Encoding.UTF8.GetBytes(input);
            string encoded = EncodingUtilities.ToHex(data);

            byte[] output = EncodingUtilities.FromHex(encoded);
            string actual = Encoding.UTF8.GetString(output);

            Assert.Equal(input, actual);
        }
Exemple #2
0
        public void ToHex_ConvertsCorrectly(string input)
        {
            // Arrange
            byte[] bytes    = Encoding.UTF8.GetBytes(input);
            string expected = ToExpectedHex(bytes);

            // Act
            string actual = EncodingUtilities.ToHex(bytes);

            // Assert
            Assert.Equal(expected, actual);
        }