Example #1
0
        public ConcordionBuilder()
        {
            SpecificationLocator = new ClassNameBasedSpecificationLocator();
            Source               = null;
            Target               = null;
            CommandRegistry      = new CommandRegistry();
            DocumentParser       = new DocumentParser(CommandRegistry);
            EvaluatorFactory     = new SimpleEvaluatorFactory();
            SpecificationCommand = new SpecificationCommand();
            AssertEqualsCommand  = new AssertEqualsCommand();
            AssertTrueCommand    = new AssertTrueCommand();
            AssertFalseCommand   = new AssertFalseCommand();
            ExecuteCommand       = new ExecuteCommand();
            RunCommand           = new RunCommand();
            VerifyRowsCommand    = new VerifyRowsCommand();
            EchoCommand          = new EchoCommand();
            ExceptionRenderer    = new ExceptionRenderer();

            // Set up the commands

            CommandRegistry.Register("", "specification", SpecificationCommand);
            WithApprovedCommand(HtmlFramework.NAMESPACE_CONCORDION_2007, "run", RunCommand);
            WithApprovedCommand(HtmlFramework.NAMESPACE_CONCORDION_2007, "execute", ExecuteCommand);
            WithApprovedCommand(HtmlFramework.NAMESPACE_CONCORDION_2007, "set", new SetCommand());
            WithApprovedCommand(HtmlFramework.NAMESPACE_CONCORDION_2007, "assertEquals", AssertEqualsCommand);
            WithApprovedCommand(HtmlFramework.NAMESPACE_CONCORDION_2007, "assertTrue", AssertTrueCommand);
            WithApprovedCommand(HtmlFramework.NAMESPACE_CONCORDION_2007, "assertFalse", AssertFalseCommand);
            WithApprovedCommand(HtmlFramework.NAMESPACE_CONCORDION_2007, "verifyRows", VerifyRowsCommand);
            WithApprovedCommand(HtmlFramework.NAMESPACE_CONCORDION_2007, "echo", EchoCommand);

            // Wire up the command listeners

            var assertEqualsResultRenderer = new AssertEqualsResultRenderer();

            AssertEqualsCommand.SuccessReported += assertEqualsResultRenderer.SuccessReportedEventHandler;
            AssertEqualsCommand.FailureReported += assertEqualsResultRenderer.FailureReportedEventHandler;
            AssertTrueCommand.SuccessReported   += assertEqualsResultRenderer.SuccessReportedEventHandler;
            AssertTrueCommand.FailureReported   += assertEqualsResultRenderer.FailureReportedEventHandler;
            AssertFalseCommand.SuccessReported  += assertEqualsResultRenderer.SuccessReportedEventHandler;
            AssertFalseCommand.FailureReported  += assertEqualsResultRenderer.FailureReportedEventHandler;

            var verifyRowsCommandRenderer = new VerifyRowResultRenderer();

            VerifyRowsCommand.MissingRowFound += verifyRowsCommandRenderer.MissingRowFoundEventHandler;
            VerifyRowsCommand.SurplusRowFound += verifyRowsCommandRenderer.SurplusRowFoundEventHandler;

            var runResultRenderer = new RunResultRenderer();

            RunCommand.SuccessfulRunReported += runResultRenderer.SuccessfulRunReportedEventHandler;
            RunCommand.FailedRunReported     += runResultRenderer.FailedRunReportedEventHandler;
            RunCommand.IgnoredRunReported    += runResultRenderer.IgnoredRunReportedEventHandler;

            var documentStructureImprovementRenderer = new DocumentStructureImprovementRenderer();

            DocumentParser.DocumentParsing += documentStructureImprovementRenderer.DocumentParsingEventHandler;

            var stylesheetEmbeddingRenderer = new StylesheetEmbeddingRenderer(HtmlFramework.EMBEDDED_STYLESHEET_RESOURCE);

            DocumentParser.DocumentParsing += stylesheetEmbeddingRenderer.DocumentParsingEventHandler;
        }
        public ConcordionBuilder()
        {
            SpecificationLocator = new ClassNameBasedSpecificationLocator();
            Source = null;
            Target = null;
            CommandRegistry = new CommandRegistry();
            DocumentParser = new DocumentParser(CommandRegistry);
            EvaluatorFactory = new SimpleEvaluatorFactory();
            SpecificationCommand = new SpecificationCommand();
            AssertEqualsCommand = new AssertEqualsCommand();
            AssertTrueCommand = new AssertTrueCommand();
            AssertFalseCommand = new AssertFalseCommand();
            ExecuteCommand = new ExecuteCommand();
            RunCommand = new RunCommand();
            VerifyRowsCommand = new VerifyRowsCommand();
            EchoCommand = new EchoCommand();
            ExceptionRenderer = new ExceptionRenderer();

            // Set up the commands

            CommandRegistry.Register("", "specification", SpecificationCommand);
            WithApprovedCommand(HtmlFramework.NAMESPACE_CONCORDION_2007, "run", RunCommand);
            WithApprovedCommand(HtmlFramework.NAMESPACE_CONCORDION_2007, "execute", ExecuteCommand);
            WithApprovedCommand(HtmlFramework.NAMESPACE_CONCORDION_2007, "set", new SetCommand());
            WithApprovedCommand(HtmlFramework.NAMESPACE_CONCORDION_2007, "assertEquals", AssertEqualsCommand);
            WithApprovedCommand(HtmlFramework.NAMESPACE_CONCORDION_2007, "assertTrue", AssertTrueCommand);
            WithApprovedCommand(HtmlFramework.NAMESPACE_CONCORDION_2007, "assertFalse", AssertFalseCommand);
            WithApprovedCommand(HtmlFramework.NAMESPACE_CONCORDION_2007, "verifyRows", VerifyRowsCommand);
            WithApprovedCommand(HtmlFramework.NAMESPACE_CONCORDION_2007, "echo", EchoCommand);

            // Wire up the command listeners

            var assertEqualsResultRenderer = new AssertEqualsResultRenderer();
            AssertEqualsCommand.SuccessReported += assertEqualsResultRenderer.SuccessReportedEventHandler;
            AssertEqualsCommand.FailureReported += assertEqualsResultRenderer.FailureReportedEventHandler;
            AssertTrueCommand.SuccessReported += assertEqualsResultRenderer.SuccessReportedEventHandler;
            AssertTrueCommand.FailureReported += assertEqualsResultRenderer.FailureReportedEventHandler;
            AssertFalseCommand.SuccessReported += assertEqualsResultRenderer.SuccessReportedEventHandler;
            AssertFalseCommand.FailureReported += assertEqualsResultRenderer.FailureReportedEventHandler;

            var verifyRowsCommandRenderer = new VerifyRowResultRenderer();
            VerifyRowsCommand.MissingRowFound += verifyRowsCommandRenderer.MissingRowFoundEventHandler;
            VerifyRowsCommand.SurplusRowFound += verifyRowsCommandRenderer.SurplusRowFoundEventHandler;

            var runResultRenderer = new RunResultRenderer();
            RunCommand.SuccessfulRunReported += runResultRenderer.SuccessfulRunReportedEventHandler;
            RunCommand.FailedRunReported += runResultRenderer.FailedRunReportedEventHandler;
            RunCommand.IgnoredRunReported += runResultRenderer.IgnoredRunReportedEventHandler;

            var documentStructureImprovementRenderer = new DocumentStructureImprovementRenderer();
            DocumentParser.DocumentParsing += documentStructureImprovementRenderer.DocumentParsingEventHandler;

            var stylesheetEmbeddingRenderer = new StylesheetEmbeddingRenderer(HtmlFramework.EMBEDDED_STYLESHEET_RESOURCE);
            DocumentParser.DocumentParsing += stylesheetEmbeddingRenderer.DocumentParsingEventHandler;
        }
        public ISpecification ReadSpecification(Resource resource)
        {
            XDocument document;

            using (var inputStream = Source.CreateReader(resource))
            {
                document = XDocument.Load(inputStream);
            }

            return(DocumentParser.Parse(document, resource));
        }
Example #4
0
        public ConcordionBuilder()
        {
            BuildListeners = new List <IConcordionBuildListener>();
            SpecificationProcessingListeners = new List <ISpecificationProcessingListener>();
            ResourceToCopyMap  = new Dictionary <string, Resource>();
            ExceptionListeners = new List <IExceptionCaughtListener>();

            SpecificationLocator = new ClassNameBasedSpecificationLocator();
            Source               = null;
            Target               = null;
            CommandRegistry      = new CommandRegistry();
            DocumentParser       = new DocumentParser(CommandRegistry);
            EvaluatorFactory     = new SimpleEvaluatorFactory();
            SpecificationCommand = new SpecificationCommand();
            AssertEqualsCommand  = new AssertEqualsCommand();
            AssertTrueCommand    = new AssertTrueCommand();
            AssertFalseCommand   = new AssertFalseCommand();
            ExecuteCommand       = new ExecuteCommand();
            RunCommand           = new RunCommand();
            VerifyRowsCommand    = new VerifyRowsCommand();
            EchoCommand          = new EchoCommand();
            ExceptionRenderer    = new ExceptionRenderer();

            WithExceptionListener(ExceptionRenderer);

            // Set up the commands

            CommandRegistry.Register("", "specification", SpecificationCommand);

            // Wire up the command listeners

            var assertResultRenderer = new AssertResultRenderer();

            WithAssertEqualsListener(assertResultRenderer);
            WithAssertTrueListener(assertResultRenderer);
            WithAssertFalseListener(assertResultRenderer);
            WithVerifyRowsListener(new VerifyRowResultRenderer());
            WithRunListener(new RunResultRenderer());
            WithDocumentParsingListener(new DocumentStructureImprover());
            WithDocumentParsingListener(new MetadataCreator());
            WithEmbeddedCss(HtmlFramework.EMBEDDED_STYLESHEET_RESOURCE);
        }
        public ConcordionBuilder()
        {
            BuildListeners = new List<IConcordionBuildListener>();
            SpecificationProcessingListeners = new List<ISpecificationProcessingListener>();
            ResourceToCopyMap = new Dictionary<string, Resource>();
            ExceptionListeners = new List<IExceptionCaughtListener>();

            SpecificationLocator = new ClassNameBasedSpecificationLocator();
            Source = null;
            Target = null;
            CommandRegistry = new CommandRegistry();
            DocumentParser = new DocumentParser(CommandRegistry);
            EvaluatorFactory = new SimpleEvaluatorFactory();
            SpecificationCommand = new SpecificationCommand();
            AssertEqualsCommand = new AssertEqualsCommand();
            AssertTrueCommand = new AssertTrueCommand();
            AssertFalseCommand = new AssertFalseCommand();
            ExecuteCommand = new ExecuteCommand();
            RunCommand = new RunCommand();
            VerifyRowsCommand = new VerifyRowsCommand();
            EchoCommand = new EchoCommand();
            ExceptionRenderer = new ExceptionRenderer();

            WithExceptionListener(ExceptionRenderer);

            // Set up the commands

            CommandRegistry.Register("", "specification", SpecificationCommand);

            // Wire up the command listeners

            var assertResultRenderer = new AssertResultRenderer();
            WithAssertEqualsListener(assertResultRenderer);
            WithAssertTrueListener(assertResultRenderer);
            WithAssertFalseListener(assertResultRenderer);
            WithVerifyRowsListener(new VerifyRowResultRenderer());
            WithRunListener(new RunResultRenderer());
            WithDocumentParsingListener(new DocumentStructureImprover());
            WithDocumentParsingListener(new MetadataCreator());
            WithEmbeddedCss(HtmlFramework.EMBEDDED_STYLESHEET_RESOURCE);
        }
 public XmlSpecificationReader(ISource source, DocumentParser documentParser)
 {
     Source         = source;
     DocumentParser = documentParser;
 }
Example #7
0
 public IConcordionExtender WithDocumentParsingListener(IDocumentParsingListener listener)
 {
     DocumentParser.AddDocumentParsingListener(listener);
     return(this);
 }
 public XmlSpecificationReader(ISource source, DocumentParser documentParser)
 {
     Source = source;
     DocumentParser = documentParser;
 }