Beispiel #1
0
                //[Variation("Read on a deep tree at least more than 4K boundary", Priority = 2)]
                public void v2()
                {
                    ManagedNodeWriter mnw = new ManagedNodeWriter();

                    mnw.PutPattern("X");

                    int count = 0;

                    do
                    {
                        mnw.PutPattern("E/");
                        count++;
                    }while (mnw.GetNodes().Length < 4096);
                    mnw.PutText("<a/>");
                    mnw.Finish();

                    XmlReader DataReader = GetReader(new StringReader(mnw.GetNodes()));

                    PositionOnElement(DataReader, "ELEMENT_1");
                    DataReader.ReadToDescendant("a");

                    TestLog.Compare(DataReader.Depth, count, "Depth is not correct");
                    TestLog.Compare(DataReader.NodeType, XmlNodeType.Element, "Nodetype is not correct");

                    while (DataReader.Read())
                    {
                        ;
                    }
                    DataReader.Dispose();
                }
Beispiel #2
0
                //[Variation("ReadSubtree for element depth more than 4K chars", Priority = 2)]
                public void v100()
                {
                    ManagedNodeWriter mnw = new ManagedNodeWriter();

                    mnw.PutPattern("X");
                    do
                    {
                        mnw.OpenElement();
                        mnw.CloseElement();
                    }while (mnw.GetNodes().Length < 4096);

                    mnw.Finish();

                    XmlReader DataReader = GetReader(new StringReader(mnw.GetNodes()));

                    PositionOnElement(DataReader, "ELEMENT_2");

                    XmlReader r = DataReader.ReadSubtree();

                    while (r.Read())
                    {
                        ;
                    }
                    r.Dispose();

                    DataReader.Read();

                    TestLog.Compare(DataReader.Name, "ELEMENT_1", "Main name doesnt match");
                    TestLog.Compare(DataReader.Value, "", "Main value doesnt match");
                    TestLog.Compare(DataReader.NodeType.ToString().ToUpperInvariant(), "ENDELEMENT", "Main nodetype doesnt match");

                    DataReader.Dispose();
                }
Beispiel #3
0
                //[Variation("Read on a deep tree atleast more than 4K boundary", Priority = 2)]
                public void v2()
                {
                    ManagedNodeWriter mnw = new ManagedNodeWriter();
                    mnw.PutPattern("X");

                    int count = 0;
                    do
                    {
                        mnw.PutPattern("E/");
                        count++;
                    }
                    while (mnw.GetNodes().Length < 4096);
                    mnw.PutText("<a/>");
                    mnw.Finish();

                    XmlReader DataReader = GetReader(new StringReader(mnw.GetNodes()));

                    PositionOnElement(DataReader, "ELEMENT_1");
                    DataReader.ReadToDescendant("a");

                    TestLog.Compare(DataReader.Depth, count, "Depth is not correct");
                    TestLog.Compare(DataReader.NodeType, XmlNodeType.Element, "Nodetype is not correct");

                    while (DataReader.Read()) ;
                    DataReader.Dispose();
                }
Beispiel #4
0
                //[Variation("ReadSubtree for element depth more than 4K chars", Priority = 2)]
                public void v100()
                {
                    ManagedNodeWriter mnw = new ManagedNodeWriter();
                    mnw.PutPattern("X");
                    do
                    {
                        mnw.OpenElement();
                        mnw.CloseElement();
                    }
                    while (mnw.GetNodes().Length < 4096);

                    mnw.Finish();

                    XmlReader DataReader = GetReader(new StringReader(mnw.GetNodes()));

                    PositionOnElement(DataReader, "ELEMENT_2");

                    XmlReader r = DataReader.ReadSubtree();
                    while (r.Read()) ;
                    r.Dispose();

                    DataReader.Read();

                    TestLog.Compare(DataReader.Name, "ELEMENT_1", "Main name doesnt match");
                    TestLog.Compare(DataReader.Value, "", "Main value doesnt match");
                    TestLog.Compare(DataReader.NodeType.ToString().ToUpperInvariant(), "ENDELEMENT", "Main nodetype doesnt match");

                    DataReader.Dispose();
                }