Beispiel #1
0
        public static void Base64Encoder()
        {
            // Arrange
            var value   = RandomHelper.NextSentence(g_random, 20);
            var encoder = new Base64Encoder(new TextEncoder(Encoding.UTF8));

            // Act
            var result = encoder.GetBytes(value);

            // Assert
            var expected = Encoding.ASCII.GetBytes(Convert.ToBase64String(Encoding.UTF8.GetBytes(value)));

            Assert.Equal(expected, result);
        }