Пример #1
0
        public int Variation_10()
        {
            string filename = null;

            NameTable_TestFiles.CreateTestFile(ref filename, EREADER_TYPE.BIG_ELEMENT_SIZE);
            XmlReader rDataReader = XmlReader.Create(FilePathUtil.getStream(filename));

            while (rDataReader.Read() == true)
            {
                ;
            }
            XmlNameTable nt       = rDataReader.NameTable;
            object       objTest1 = nt.Get(BigStr + "Z");
            object       objTest2 = nt.Get(BigStr + "X");
            object       objTest3 = nt.Get(BigStr + "Y");

            if (objTest1 != null)
            {
                throw new CTestException(CTestBase.TEST_FAIL, "objTest1 is not null");
            }
            if (objTest2 == null)
            {
                throw new CTestException(CTestBase.TEST_FAIL, "objTest2 is null");
            }
            if (objTest3 == null)
            {
                throw new CTestException(CTestBase.TEST_FAIL, "objTest3 is  null");
            }

            if ((objTest1 == objTest2) || (objTest1 == objTest3) || (objTest2 == objTest3))
            {
                throw new CTestException(CTestBase.TEST_FAIL, "objTest1 is equal to objTest2, or objTest3");
            }
            return(TEST_PASS);
        }
Пример #2
0
        public int Variation_8()
        {
            ////////////////////////////
            // Add strings again and verify

            string filename = null;

            NameTable_TestFiles.CreateTestFile(ref filename, EREADER_TYPE.BIG_ELEMENT_SIZE);
            XmlReader rDataReader = XmlReader.Create(FilePathUtil.getStream(filename));

            while (rDataReader.Read() == true)
            {
                ;
            }
            XmlNameTable nt = rDataReader.NameTable;

            string strTest = BigStr + "X";

            char[] chTest     = strTest.ToCharArray();
            Object objActual1 = nt.Add(chTest, 0, chTest.Length);
            Object objActual2 = nt.Add(chTest, 0, chTest.Length);

            CError.Compare(objActual1, objActual2, "Comparing objActual1 and objActual2");
            CError.Compare(objActual1, nt.Get(chTest, 0, chTest.Length), "Comparing objActual1 and GetCharArray");
            CError.Compare(objActual1, nt.Get(strTest), "Comparing objActual1 and GetString");
            CError.Compare(objActual1, nt.Add(strTest), "Comparing objActual1 and AddString");

            NameTable_TestFiles.RemoveDataReader(EREADER_TYPE.BIG_ELEMENT_SIZE);

            return(TEST_PASS);
        }
Пример #3
0
        public override int Init(object objParam)
        {
            int ret = base.Init(objParam);

            _TestData = Path.Combine(FilePathUtil.GetTestDataPath(), @"XmlReader");

            // Create global usage test files
            string strFile = String.Empty;

            NameTable_TestFiles.CreateTestFile(ref strFile, EREADER_TYPE.GENERIC);

            return(ret);
        }