Beispiel #1
0
 public void ParseReferenceNameExpectedIdentifier()
 {
     ReferenceParser parser = new ReferenceParser();
     ParseWithoutIdentifier(parser, "TestFiles.Parsing.ClassForReferencesTests.");
     ParseWithoutIdentifier(parser, "TestFiles.Parsing.ClassForReferencesTests.%%");
     ParseWithoutIdentifier(parser, "TestFiles.Parsing.ClassForReferencesTests.-");
 }
Beispiel #2
0
        public void ParseReferenceNameSuccess()
        {
            ReferenceParser parser = new ReferenceParser();
            log4net.Psi.Tree.Impl.ReferenceName referenceName = parser.ParseReferenceName("TestFiles.Parsing.ClassForReferencesTests");

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

            Assert.AreEqual("int", referenceName.GetName());
        }
Beispiel #4
0
 public void ParseReferenceNameExpectedIdentifier()
 {
     ReferenceParser parser = new ReferenceParser();
     ParseWithoutIdentifier(parser, "Arp.Common.");
     ParseWithoutIdentifier(parser, "Arp.Common.%%");
     ParseWithoutIdentifier(parser, "Arp.Common.-");
 }
Beispiel #5
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&%"));
 }
Beispiel #6
0
 public void ParseReferenceNameWithUnnecessaryEnd()
 {
     ReferenceParser parser = new ReferenceParser();
     Check(parser.ParseModule("Arp.Common "));
     Check(parser.ParseModule("Arp.Common;"));
     Check(parser.ParseModule("Arp.Common\""));
     Check(parser.ParseModule("Arp.Common&%"));
 }
Beispiel #7
0
        private void CreateModuleReferenceAttributeValue(INHElement element, IXmlAttribute attribute)
        {
            if (attribute.Value == null)
                return;

            ReferenceParser parser = new ReferenceParser();
            IXmlAttributeValue newElement = parser.ParseReferenceModule(attribute.Value);
            ReplaceAttributeValue(attribute, newElement);
        }
Beispiel #8
0
        private void CreateMappingMemberReferenceAttributeValue(INHElement element, IXmlAttribute attribute, IXmlTagContainer parent)
        {
            if (attribute.Value == null)
                return;

            ReferenceParser parser = new ReferenceParser();
            IQualifier qualifier = GetElementQualifier(element, parent);
            IXmlAttributeValue newElement = parser.ParseReferenceIdentifier(attribute.Value, qualifier);
            ReplaceAttributeValue(attribute, newElement);
        }
Beispiel #9
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);
        }
Beispiel #10
0
        private void ParseWithoutIdentifier(ReferenceParser parser, string text)
        {
            try
            {

                parser.ParseModule(text);
            }
            catch (UnexpectedToken ex)
            {
                ReferenceModule referenceName = (ReferenceModule)ex.ParsingResult;

                CheckWithoutIdentifier(referenceName);
                return;
            }

            Assert.Fail("Expected UnexpectedToken exception");
        }
Beispiel #11
0
        private void CreateTypeWithNHAliasReferenceAttributeValue(INHElement element, IXmlAttribute attribute)
        {
            if (attribute.Value == null)
                return;

            var parser = new ReferenceParser();
            var newElement = parser.ParseReferenceType(attribute.Value, new NHGlobalQualifier(element));
            ReplaceAttributeValue(attribute, newElement);
        }
Beispiel #12
0
 public void ParseReferenceNameSuccess()
 {
     ReferenceParser parser = new ReferenceParser();
     ReferenceModule referenceName = parser.ParseModule("Arp.Common");
     Check(referenceName);
 }