7 namespace MonoTests.System.Text {
10 public class UTF32EncodingTest : Assertion {
13 public void TestGetPreamble() {
14 byte[] lePreamble = new UTF32Encoding(false, true).GetPreamble();
15 if (!AreEqual(lePreamble, new byte[]{ 0xff, 0xfe, 0, 0 })) {
16 Fail ("Little-endian UTF32 preamble is incorrect");
19 byte[] bePreamble = new UTF32Encoding(true, true).GetPreamble();
20 if (!AreEqual(bePreamble, new byte[]{ 0, 0, 0xfe, 0xff })) {
21 Fail ("Big-endian UTF32 preamble is incorrect");
25 private bool AreEqual(byte[] a, byte[] b) {
26 if (a.Length != b.Length)
28 for (int i = 0; i < a.Length; ++i) {