Exemple #1
0
        private HtmlTag buildDocument(Guid chainId, Action <DetailsTableTag, BehaviorChain, RouteReport> action)
        {
            writeAssets();

            var chain = _graph.Behaviors.FirstOrDefault(x => x.UniqueId == chainId);

            if (chain == null)
            {
                return(new HtmlTag("div").Text("This route cannot be found"));
            }

            var top = _document.Push("div");

            var report  = RouteReport.ForChain(chain, _urls);
            var details = buildDetails(report);

            action(details, chain, report);

            return(top);
        }
Exemple #2
0
        public ChainVisualization get_chain_details_Id(ChainDetailsRequest request)
        {
            writeAssets();

            var chain = _graph.Behaviors.FirstOrDefault(x => x.UniqueId == request.Id);

            if (chain == null)
            {
                return(new ChainVisualization
                {
                    RedirectTo = FubuContinuation.RedirectTo <ChainEndpoint>(x => x.get_chain_missing())
                });
            }

            var report = RouteReport.ForChain(chain, _urls);

            return(new ChainVisualization {
                Chain = chain,
                Details = buildDetails(report),
                Report = report,
                BehaviorVisualization = new LiteralTag(_document.Visualize(chain.NonDiagnosticNodes()))
            });
        }
 public void SetUp()
 {
     theChain = new BehaviorChain();
     theUrls  = new StubUrlRegistry();
     _report  = new Lazy <RouteReport>(() => RouteReport.ForChain(theChain, theUrls));
 }