public void T3() { //ScriptCompiler.Init(); string text = @" using System; public class HelloWorld { }"; var visitor = SyntaxRootVisitor.CreateFrom(text); Assert.Equal(default, visitor.NamespaceName());
public void T1() { //ScriptCompiler.Init(); string text = @" namespace HelloWorld { }"; var visitor = SyntaxRootVisitor.CreateFrom(text); Assert.Equal(0, visitor.UsingNames().Count()); }
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()); }