public void StringToBtyesTest() { string inSting = "初始化为适当的值"; byte[] actual = ConvertCode.StringToBtyes(inSting); string text = ConvertCode.BytesToString(actual, Separate.None); Assert.AreEqual(text, inSting); }
public void BytesToStringTest() { byte[] bytes = new byte[] { 1, 2, 3 }; Separate se = new Separate(); string actual = ConvertCode.BytesToString(bytes, se); byte[] expected = ConvertCode.StringToBtyes(actual); Assert.AreEqual(expected.ArrayAreEqual(bytes), true); }