Ejemplo n.º 1
0
            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())
                    );
            }
Ejemplo n.º 2
0
            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();
            }
Ejemplo n.º 3
0
            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();
            }