예제 #1
0
        public void TestDefaultEndianExprIsLe()
        {
            var r = DefaultEndianExprIsLe.FromFile(SourceFile("endian_expr.bin"));

            Assert.AreEqual(r.Docs[0].Indicator, new byte[] { 73, 73 });
            Assert.AreEqual(r.Docs[0].Main.SomeInt, 66);
            Assert.AreEqual(r.Docs[0].Main.SomeIntBe, 66);
            Assert.AreEqual(r.Docs[0].Main.SomeIntLe, 66);
            Assert.AreEqual(r.Docs[1].Indicator, new byte[] { 77, 77 });
            Assert.AreEqual(r.Docs[1].Main.SomeInt, 66);
            Assert.AreEqual(r.Docs[1].Main.SomeIntBe, 66);
            Assert.AreEqual(r.Docs[1].Main.SomeIntLe, 66);
            Assert.AreEqual(r.Docs[2].Indicator, new byte[] { 88, 88 });
            Assert.AreEqual(r.Docs[2].Main.SomeInt, 66);
            Assert.AreEqual(r.Docs[2].Main.SomeIntBe, 66);
            Assert.AreEqual(r.Docs[2].Main.SomeIntLe, 66);
        }
예제 #2
0
        public void TestDefaultEndianExprIsLe()
        {
            var r = DefaultEndianExprIsLe.FromFile(SourceFile("endian_expr.bin"));

            Assert.AreEqual(r.Docs[0].Indicator, new byte[] { 0x49, 0x49 });
            Assert.AreEqual(r.Docs[0].Main.SomeInt, 0x42);
            Assert.AreEqual(r.Docs[0].Main.SomeIntBe, 0x42);
            Assert.AreEqual(r.Docs[0].Main.SomeIntLe, 0x42);

            Assert.AreEqual(r.Docs[1].Indicator, new byte[] { 0x4d, 0x4d });
            Assert.AreEqual(r.Docs[1].Main.SomeInt, 0x42);
            Assert.AreEqual(r.Docs[1].Main.SomeIntBe, 0x42);
            Assert.AreEqual(r.Docs[1].Main.SomeIntLe, 0x42);

            Assert.AreEqual(r.Docs[2].Indicator, new byte[] { 0x58, 0x58 });
            Assert.AreEqual(r.Docs[2].Main.SomeInt, 0x42);
            Assert.AreEqual(r.Docs[2].Main.SomeIntBe, 0x42);
            Assert.AreEqual(r.Docs[2].Main.SomeIntLe, 0x42);
        }