public void ConvertToStringToByteToStream() { var hexBytes = Encoding.UTF8.GetBytes(OriginalString); var hexBytes2 = OriginalString.ToBytes(Encoding.UTF8); Assert.AreEqual(hexBytes, hexBytes2); var hexBytes3 = StringTool.ToStream(OriginalString, Encoding.UTF8).ToBytes(); Assert.AreEqual(hexBytes2, hexBytes3); }
public void CanHexDumpString() { var dumpString = HexTextTool.GetHexDumpString(HexBytes); Assert.IsNotEmpty(dumpString); var dumpString2 = HexTextTool.GetHexDumpString(StringTool.ToStream(OriginalString, Encoding.UTF8)); Assert.IsNotEmpty(dumpString2); //Console.WriteLine(dumpString); //Console.WriteLine(); //Console.WriteLine(dumpString2); Assert.AreEqual(dumpString, dumpString2); }