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&%")); }
public void ParseReferenceNameSuccess() { ReferenceParser parser = new ReferenceParser(); log4net.Psi.Tree.Impl.ReferenceName referenceName = parser.ParseReferenceName("TestFiles.Parsing.ClassForReferencesTests"); Check(referenceName); }
public void ParseKeyword() { ReferenceParser parser = new ReferenceParser(); log4net.Psi.Tree.Impl.ReferenceName referenceName = parser.ParseReferenceName("int", null); Assert.AreEqual("int", referenceName.GetName()); }
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); }
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); }
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"); }