public void ReadUtf8EncodingTest() { var payload = new byte[] { 0x41 }; Encoding result; using (var reader = new FrameDataReader(payload)) { result = reader.ReadEncoding((byte)TextEncodingType.Utf8, 0); Assert.AreEqual(0, reader.Position); } Assert.IsNotNull(result); Assert.AreEqual(Encoding.UTF8.CodePage, result.CodePage); }
public void ReadBigEndianUnicodeEncodingTest() { var payload = new byte[] { 0xFE, 0xFF, 0x41 }; Encoding result; using (var reader = new FrameDataReader(payload)) { result = reader.ReadEncoding((byte)TextEncodingType.Unicode, 0); Assert.AreEqual(2, reader.Position); } Assert.IsNotNull(result); Assert.AreEqual(Encoding.BigEndianUnicode.CodePage, result.CodePage); }