public void NoPageDirective_NothingWrong()
        {
            var compilationInfo = new TemplateCompilationInfo("name");
            compilationInfo.OriginalLines = ToInputLines(@"");

            var step = new ExtractPageDirectiveStep();

            step.Execute(compilationInfo);

            Assert.That(compilationInfo.OriginalLines[0].Processed, Is.False);
            Assert.That(compilationInfo.PageDirective, Is.Null);
        }
        public void TwoPageDirectives_Throws()
        {
            var compilationInfo = new TemplateCompilationInfo("name");
            compilationInfo.OriginalLines = ToInputLines(
                @"<%@Page Language=""C#""%>",
                @"<%@Page Language=""C#""%>");

            var step = new ExtractPageDirectiveStep();

            Assert.Throws<Exception>(() =>
                step.Execute(compilationInfo)
            );
        }
        public void PageDirectivewithInheritsAttribute_BaseClassIsSet()
        {
            var compilationInfo = new TemplateCompilationInfo("name");
            compilationInfo.OriginalLines = ToInputLines(@"<%@Page Language=""C#"" Inherits=""Foo""%>");

            var step = new ExtractPageDirectiveStep();

            step.Execute(compilationInfo);

            Assert.That(compilationInfo.OriginalLines[0].Processed, Is.True);
            Assert.That(compilationInfo.PageDirective, Is.Not.Null);
            Assert.That(compilationInfo.PageDirective.LineNo, Is.EqualTo(1));
            Assert.That(compilationInfo.PageDirective.BaseClass, Is.EqualTo("Foo"));
        }
        public void DummyPageDirective_FoundAndProcessed()
        {
            var compilationInfo = new TemplateCompilationInfo("name");
            compilationInfo.OriginalLines = ToInputLines(@"<%@Page Language=""C#""%>");

            var step = new ExtractPageDirectiveStep();

            step.Execute(compilationInfo);

            Assert.That(compilationInfo.OriginalLines[0].Processed, Is.True);
            Assert.That(compilationInfo.PageDirective, Is.Not.Null);
            Assert.That(compilationInfo.PageDirective.LineNo, Is.EqualTo(1));
            Assert.That(compilationInfo.PageDirective.BaseClass, Is.Null);
        }