예제 #1
0
        public void TestToString()
        {
            EscherBSERecord record = CreateRecord();
            String          nl     = Environment.NewLine;

            Assert.AreEqual("EscherBSERecord:" + nl +
                            "  RecordId: 0xF007" + nl +
                            "  Version: 0x0001" + '\n' +
                            "  Instance: 0x0000" + '\n' +
                            "  BlipTypeWin32: 5" + nl +
                            "  BlipTypeMacOS: 5" + nl +
                            "  SUID: [01, 02, 03, 04, 05, 06, 07, 08, 09, 0A, 0B, 0C, 0D, 0E, 0F, 00, ]" + nl +
                            "  Tag: 1" + nl +
                            "  Size: 0" + nl +
                            "  Ref: 2" + nl +
                            "  Offset: 3" + nl +
                            "  Usage: 4" + nl +
                            "  Name: 5" + nl +
                            "  Unused2: 6" + nl +
                            "  Unused3: 7" + nl +
                            "  blipRecord: null" + nl +
                            "  Extra Data:" + nl +
                            "No Data" + nl
                            , record.ToString());
        }
예제 #2
0
        public void Test47143()
        {
            byte[]          data = _samples.ReadFile("47143.dat");
            EscherBSERecord bse  = new EscherBSERecord();

            bse.FillFields(data, 0, new DefaultEscherRecordFactory());
            bse.ToString(); //assert that toString() works
            Assert.IsTrue(bse.BlipRecord is EscherMetafileBlip);

            EscherMetafileBlip blip = (EscherMetafileBlip)bse.BlipRecord;

            blip.ToString(); //assert that toString() works
            byte[] remaining = blip.RemainingData;
            Assert.IsNotNull(remaining);

            byte[] ser = bse.Serialize();  //serialize and assert against the source data
            Assert.IsTrue(Arrays.Equals(data, ser));
        }