Ejemplo n.º 1
0
 public void ParseReferenceNameWithUnnecessaryEnd()
 {
     ReferenceParser parser = new ReferenceParser();
     Check(parser.ParseReferenceName("TestFiles.Parsing.ClassForReferencesTests "));
     Check(parser.ParseReferenceName("TestFiles.Parsing.ClassForReferencesTests;"));
     Check(parser.ParseReferenceName("TestFiles.Parsing.ClassForReferencesTests\""));
     Check(parser.ParseReferenceName("TestFiles.Parsing.ClassForReferencesTests&%"));
 }
Ejemplo n.º 2
0
        public void ParseReferenceNameSuccess()
        {
            ReferenceParser parser = new ReferenceParser();
            log4net.Psi.Tree.Impl.ReferenceName referenceName = parser.ParseReferenceName("TestFiles.Parsing.ClassForReferencesTests");

            Check(referenceName);
        }
Ejemplo n.º 3
0
        public void ParseKeyword()
        {
            ReferenceParser parser = new ReferenceParser();
            log4net.Psi.Tree.Impl.ReferenceName referenceName = parser.ParseReferenceName("int", null);

            Assert.AreEqual("int", referenceName.GetName());
        }
Ejemplo n.º 4
0
        private void CreateReferenceAttributeValue(IL4NElement element, IXmlAttribute attribute)
        {
            if(attribute.Value == null)
                return;

            ReferenceParser parser = new ReferenceParser();
            IXmlAttributeValue newElement = parser.ParseReferenceName(attribute.Value);
            IXmlAttributeValueNode childNode = attribute.Value.ToTreeNode();
            ITreeNode parent = attribute.ToTreeNode();
            ((CompositeElement)parent).AddChildAfter(newElement.ToTreeNode(), childNode);
            ((CompositeElement)parent).DeleteChildRange(childNode, childNode);
        }
Ejemplo n.º 5
0
        private void CreateNamespaceReferenceAttributeValue(INHElement element, IXmlAttribute attribute)
        {
            if (attribute.Value == null)
                return;

            ReferenceParser parser = new ReferenceParser();
            IXmlAttributeValue newElement = parser.ParseReferenceName(attribute.Value);
            ReplaceAttributeValue(attribute, newElement);
        }
Ejemplo n.º 6
0
        private void ParseWithoutIdentifier(ReferenceParser parser, string text)
        {
            try
            {

                parser.ParseReferenceName(text);
            }
            catch (UnexpectedToken ex)
            {
                ReferenceName referenceName = (ReferenceName) ex.ParsingResult;

                CheckWithoutIdentifier(referenceName);
                return;
            }

            Assert.Fail("Expected UnexpectedToken exception");
        }