Esempio n. 1
0
        public void TestReserializeRefNTokens()
        {
            RecordInputStream is1 = TestcaseRecordInputStream.Create(CFRuleRecord.sid, DATA_REFN);
            CFRuleRecord      rr  = new CFRuleRecord(is1);

            Ptg[] ptgs = rr.ParsedExpression1;
            Assert.AreEqual(3, ptgs.Length);
            if (ptgs[0] is RefPtg)
            {
                throw new AssertionException("Identified bug 45234");
            }
            Assert.AreEqual(typeof(RefNPtg), ptgs[0].GetType());
            RefNPtg refNPtg = (RefNPtg)ptgs[0];

            Assert.IsTrue(refNPtg.IsColRelative);
            Assert.IsTrue(refNPtg.IsRowRelative);

            byte[] data = rr.Serialize();

            TestcaseRecordInputStream.ConfirmRecordEncoding(CFRuleRecord.sid, DATA_REFN, data);
        }
Esempio n. 2
0
        public void TestReserializeRefNTokens()
        {
            RecordInputStream is1 = TestcaseRecordInputStream.Create(CFRuleRecord.sid, DATA_REFN);
            CFRuleRecord      rr  = new CFRuleRecord(is1);

            Ptg[] ptgs = rr.ParsedExpression1;
            Assert.AreEqual(3, ptgs.Length);
            if (ptgs[0] is RefPtg)
            {
                throw new AssertFailedException("Identified bug 45234");
            }
            Assert.AreEqual(typeof(RefNPtg), ptgs[0].GetType());
            RefNPtg refNPtg = (RefNPtg)ptgs[0];

            Assert.IsTrue(refNPtg.IsColRelative);
            Assert.IsTrue(refNPtg.IsRowRelative);

            byte[] data = rr.Serialize();

            if (!CompareArrays(DATA_REFN, 0, data, 4, DATA_REFN.Length))
            {
                Assert.Fail("Did not re-serialize correctly");
            }
        }