public void ShouldAllowSingleLineCommentsBeforeDirectives() { var testableDirectiveProcessor = new DirectiveLineProcessorTests.TestableDirectiveLineProcessor(BehaviorAfterCode.Throw); var filePreprocessor = GetFilePreProcessor(testableDirectiveProcessor, new LoadLineProcessor(_fileSystem.Object)); var lines = new List <string> { "//Test Comment", "#Test something", "Console.WriteLine(\"Success\");" }; Assert.DoesNotThrow( () => filePreprocessor.ParseScript(lines, new FileParserContext()) ); }
public void ShouldProcessALoadDirectiveWhenItComesAfterACustomDirective() { var testableDirectiveProcessor = new DirectiveLineProcessorTests.TestableDirectiveLineProcessor(); var loadLineProcessor = new TestableLoadLineProcessor(_fileSystem.Object); var filePreprocessor = GetFilePreProcessor(testableDirectiveProcessor, loadLineProcessor); var lines = new List <string> { "#Test something", "#load myscript.csx", "Console.WriteLine(\"Success\");" }; filePreprocessor.ParseScript(lines, new FileParserContext()); loadLineProcessor.InheritedProcessLineCalled.ShouldBeTrue(); }
public void ShouldProcessALoadDirectiveWhenItComesAfterACustomDirective() { var testableDirectiveProcessor = new DirectiveLineProcessorTests.TestableDirectiveLineProcessor(); var loadLineProcessor = new TestableLoadLineProcessor(_fileSystem.Object); var filePreprocessor = GetFilePreProcessor(testableDirectiveProcessor, loadLineProcessor); var lines = new List<string> { "#Test something", "#load myscript.csx", "Console.WriteLine(\"Success\");" }; filePreprocessor.ParseScript(lines, new FileParserContext()); loadLineProcessor.InheritedProcessLineCalled.ShouldBeTrue(); }