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)); }
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()); }
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)); }