예제 #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&%"));
 }
예제 #2
0
        public void ParseReferenceNameSuccess()
        {
            ReferenceParser parser = new ReferenceParser();
            log4net.Psi.Tree.Impl.ReferenceName referenceName = parser.ParseReferenceName("TestFiles.Parsing.ClassForReferencesTests");

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

            Assert.AreEqual("int", referenceName.GetName());
        }
예제 #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);
        }
예제 #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);
        }
예제 #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");
        }