public void WriteEncodingByteTest() { byte[] result; using (var writer = new FrameDataWriter()) { writer.WriteEncodingByte(Encoding.Unicode); result = writer.ToArray(); } Assert.IsNotNull(result); Assert.That(result[0], Is.EqualTo((byte)TextEncodingType.Unicode)); }
public void WritePreambleTest() { byte[] result; using (var writer = new FrameDataWriter()) { writer.WriteEncodingByte(Encoding.Unicode); writer.WritePreamble(Encoding.Unicode); result = writer.ToArray(); } Assert.IsNotNull(result); Assert.AreEqual(3, result.Length); Assert.AreEqual((byte)TextEncodingType.Unicode, result[0]); Assert.AreEqual(0xFF, result[1]); Assert.AreEqual(0xFE, result[2]); }