示例#1
0
        public void T3()
        {
            //ScriptCompiler.Init();
            string text    = @"
using System;
public class HelloWorld
{
}";
            var    visitor = SyntaxRootVisitor.CreateFrom(text);

            Assert.Equal(default, visitor.NamespaceName());
示例#2
0
        public void T1()
        {
            //ScriptCompiler.Init();
            string text    = @"
namespace HelloWorld
{
}";
            var    visitor = SyntaxRootVisitor.CreateFrom(text);

            Assert.Equal(0, visitor.UsingNames().Count());
        }
示例#3
0
        public void T2()
        {
            //ScriptCompiler.Init();
            string text    = @"using System;
namespace HelloWorld
{
}";
            var    visitor = SyntaxRootVisitor.CreateFrom(text);

            Assert.Equal("System", visitor.UsingNames().First());
            Assert.Equal($"using System;{Environment.NewLine}", visitor.UsingFullScripts().First());
        }