示例#1
0
        public void TestXNameGetInvocationsAreFullyQualified()
        {
            var atomXsdFileInfo   = new FileInfo(AtomXsdFilePath);
            CSharpSyntaxTree tree = Utilities.GenerateSyntaxTree(atomXsdFileInfo);

            TestContext.CurrentContext.DumpDebugOutputToFile(debugStrings: new [] { tree.ToString() });

            NamespaceDeclarationSyntax root = tree.GetNamespaceRoot();
            var sourceCode = root.ToFullString();

            var xNameInvocationsUpToMethodName =
                Regex.Matches(sourceCode, "System\\.Xml\\.Linq\\.XName\\.Get\\(\"", RegexOptions.Multiline);

            Assert.IsNotEmpty(xNameInvocationsUpToMethodName);
            Assert.IsTrue(xNameInvocationsUpToMethodName.Count == 630);
        }