예제 #1
0
        public void ToUtf8String_InstantiatedWithRandomBytes_ShouldReturnUtf8String()
        {
            var randomBytes = GenerateMe.RandomBytes();

            var buffer       = new VirgilBuffer(randomBytes);
            var resultString = buffer.ToString();

            resultString.Should().Be(Encoding.UTF8.GetString(randomBytes));
        }
예제 #2
0
        public void ToHEXString_InstantiatedWithRandomBytes_ShouldReturnNotSeporatedLovercaseHexString()
        {
            var randomBytes = GenerateMe.RandomBytes();

            var buffer       = new VirgilBuffer(randomBytes);
            var resultString = buffer.ToString(StringEncoding.Hex);

            resultString.Should().Be(BitConverter.ToString(randomBytes).Replace("-", "").ToLower());
        }
예제 #3
0
        public void ToBase64String_InstantiatedWithRandomBytes_ShouldReturnBase64EncodedString()
        {
            var randomBytes = GenerateMe.RandomBytes();

            var buffer       = new VirgilBuffer(randomBytes);
            var resultString = buffer.ToString(StringEncoding.Base64);

            resultString.Should().Be(Convert.ToBase64String(randomBytes));
        }