Exemplo n.º 1
0
        public void SetUp()
        {
            graph = new FubuRegistry().BuildGraph();
            urls = MockRepository.GenerateMock<IUrlRegistry>();

            writer = new BehaviorGraphWriter(graph, urls, null, new StubCurrentHttpRequest("http://server"));
        }
Exemplo n.º 2
0
 public KatanaHostingActivator(KatanaSettings settings, FubuRouteTable routes, IUrlRegistry urls, IServiceLocator services)
 {
     _settings = settings;
     _routes = routes.Routes;
     _urls = urls;
     _services = services;
 }
Exemplo n.º 3
0
 public KatanaHostingActivator(KatanaSettings settings, FubuRouteTable routes, IUrlRegistry urls, IServiceLocator services)
 {
     _settings = settings;
     _routes   = routes.Routes;
     _urls     = urls;
     _services = services;
 }
 public BootstrapAuthorizationFailureHandler(IOutputWriter writer, IRequestData requestData, IUrlRegistry urlRegistry, IHttpRequest currentHttpRequest)
 {
     _writer = writer;
     _requestData = requestData;
     _urlRegistry = urlRegistry;
     _currentHttpRequest = currentHttpRequest;
 }
Exemplo n.º 5
0
 public AjaxAuthenticationRedirect(IRequestData data, IJsonWriter jsonWriter, IOutputWriter outputWriter, IUrlRegistry urls)
 {
     _data         = data;
     _jsonWriter   = jsonWriter;
     _outputWriter = outputWriter;
     _urls         = urls;
 }
Exemplo n.º 6
0
 public ResourceAction(ConnegActionFinder connegActionActionFinder, ActionCallMapper actionCallMapper, IUrlRegistry urlRegistry, ICurrentHttpRequest currentHttpRequest)
 {
     _connegActionActionFinder = connegActionActionFinder;
     _actionCallMapper = actionCallMapper;
     _urlRegistry = urlRegistry;
     _currentHttpRequest = currentHttpRequest;
 }
Exemplo n.º 7
0
 public ExampleHtmlWriter(IServiceLocator serviceLocator, IUrlRegistry urlRegistry, BehaviorGraph behaviorGraph)
 {
     _serviceLocator = serviceLocator;
     _urlRegistry    = urlRegistry;
     _behaviorGraph  = behaviorGraph;
     _examplePageUrl = "_fubu/html/example".ToAbsoluteUrl();
 }
        public void SetUp()
        {
            graph = new FubuRegistry(x => { x.Applies.ToThisAssembly(); }).BuildGraph();
            urls = MockRepository.GenerateMock<IUrlRegistry>();

            writer = new BehaviorGraphWriter(graph, urls);
        }
Exemplo n.º 9
0
        public void SetUp()
        {
            urls = MockRepository.GenerateMock<IUrlRegistry>();
            page = MockRepository.GenerateMock<IFubuPage>();

            page.Stub(x => x.Urls).Return(urls);
        }
Exemplo n.º 10
0
 public CaseController(IRepository repository, FubuHtmlDocument <Case> document, ISqlRunner runner, IUrlRegistry urls)
 {
     _repository = repository;
     _document   = document;
     _runner     = runner;
     _urls       = urls;
 }
Exemplo n.º 11
0
 public ExampleHtmlWriter(IServiceLocator serviceLocator, IUrlRegistry urlRegistry, BehaviorGraph behaviorGraph)
 {
     _serviceLocator = serviceLocator;
     _urlRegistry = urlRegistry;
     _behaviorGraph = behaviorGraph;
     _examplePageUrl = "_fubu/html/example".ToAbsoluteUrl();
 }
        public DiagnosticMenuTag(IDiagnosticContext context, ICurrentHttpRequest currentHttpRequest, IUrlRegistry urls) : base("ul")
        {
            AddClass("nav");

            var group = context.CurrentGroup();

            var index = group.Index();
            if (index != null)
            {
                addLink(index, context, currentHttpRequest);
            }
            else
            {
                var url = urls.UrlFor(new GroupRequest {Name = group.Name});
                var li = Add("li");
                li.Add("a").Attr("href", url).Text(group.Name).Attr("title", group.Description);

                if (context.CurrentChain() == null)
                {
                    li.AddClass("active");
                }
            }

            group.Links().Each(x => addLink(x, context, currentHttpRequest));
        }
Exemplo n.º 13
0
        public void SetUp()
        {
            graph = new FubuRegistry().BuildGraph();
            urls = MockRepository.GenerateMock<IUrlRegistry>();

            writer = new BehaviorGraphWriter(graph, urls, null);
        }
Exemplo n.º 14
0
 public NavigationService(BehaviorGraph graph, ICurrentHttpRequest request, IMenuStateService stateService, IUrlRegistry urls)
 {
     _request      = request;
     _stateService = stateService;
     _urls         = urls;
     _navigation   = graph.Settings.Get <NavigationGraph>();
 }
Exemplo n.º 15
0
 public PostHandler(IDocumentDatabase database, ISecurityContext securityContext,
                    IUrlRegistry urlRegistry)
 {
     _database        = database;
     _securityContext = securityContext;
     _urlRegistry     = urlRegistry;
 }
        public RequestLinksTag(RequestLog log, IUrlRegistry urls)
        {
            AddHeader("Chain Details");

            Add("li").Add("a").Id("chain-summary").Attr("href", "#").Text("View Summary");
            Add("li").Add("span/a").Attr("href", urls.UrlFor(new ChainDetailsRequest{Id = log.ChainId})).Text("View Details").AddClass("external").Attr("target", "_blank");
        }
Exemplo n.º 17
0
 public SingleContentEndpoint(IRepository<Content> repository, SiteSettings settings, ServerVariables vars, IUrlRegistry reg)
 {
     _repository = repository;
     _settings = settings;
     _vars = vars;
     _reg = reg;
 }
 public ProductNotFoundConvention(IOutputWriter outputWriter, IUrlRegistry urlRegistry, IFubuRequest fubuRequest)
     : base(PartialBehavior.Executes)
 {
     _outputWriter = outputWriter;
     _urlRegistry  = urlRegistry;
     _fubuRequest  = fubuRequest;
 }
Exemplo n.º 19
0
 public BehaviorGraphWriter(BehaviorGraph graph, IUrlRegistry urls, IServiceLocator services)
 {
     _graph = graph;
     _urls = urls;
     _services = services;
     _diagnosticsNamespace = GetType().Namespace;
 }
        protected MessagesTableTag(IEnumerable <QueueMessage> messages, IUrlRegistry urls,
                                   Action <TableRowTag> additionalHeaders, Action <TableRowTag, PersistentMessage> additionalColumns)
        {
            _urls = urls;
            AddClass("table");

            AddHeaderRow(row =>
            {
                row.Header("Id");
                row.Header("Status");
                row.Header("Sent At");
                row.Header("Headers");
                if (additionalHeaders != null)
                {
                    additionalHeaders(row);
                }
            });

            messages.Each(message => AddBodyRow(row =>
            {
                AddMessageRow(row, message);
                if (additionalColumns != null)
                {
                    additionalColumns(row, message.InternalMessage);
                }
            }));
        }
		public AjaxAuthenticationRedirect(IRequestData data, IJsonWriter jsonWriter, IOutputWriter outputWriter, IUrlRegistry urls)
		{
			_data = data;
			_jsonWriter = jsonWriter;
			_outputWriter = outputWriter;
			_urls = urls;
		}
Exemplo n.º 22
0
 public SamlEndpoint(IRequestData requestData, SamlResponseRedirector redirector, IUrlRegistry urls, ISamlResponseWriter writer)
 {
     _requestData = requestData;
     _redirector  = redirector;
     _urls        = urls;
     _writer      = writer;
 }
Exemplo n.º 23
0
 public SamlEndpoint(IRequestData requestData, SamlResponseRedirector redirector, IUrlRegistry urls, ISamlResponseWriter writer)
 {
     _requestData = requestData;
     _redirector = redirector;
     _urls = urls;
     _writer = writer;
 }
Exemplo n.º 24
0
 public DiagnosticBehavior(IDebugReport report, IDebugDetector detector, IActionBehavior inner, IUrlRegistry urls)
 {
     _report   = report;
     _detector = detector;
     _inner    = inner;
     _urls     = urls;
 }
Exemplo n.º 25
0
        public static HtmlDocument BuildDocument(IUrlRegistry urls, string title, params HtmlTag[] tags)
        {
            string css = GetDiagnosticCss();

            var realTitle = "FubuMVC: " + title;

            var document = new HtmlDocument();

            document.Title = realTitle;

            var mainDiv = new HtmlTag("div").AddClass("main");

            mainDiv.Add("h2").Text("FubuMVC Diagnostics").Append(buildVersionTag());
            var navBar = mainDiv.Add("div").AddClass("homelink");

            if (urls != null)
            {
                navBar.Append(new LinkTag("Home", urls.UrlFor <BehaviorGraphWriter>(w => w.Index(), null)));
            }
            navBar.Add("span").Text(" > " + title);
            document.Add(mainDiv);

            mainDiv.Append(tags);

            document.AddStyle(css);

            return(document);
        }
Exemplo n.º 26
0
 public ProjectEndpoints(IUrlRegistry urls, ITopicTokenCache tokenCache, ISnippetCache cache, AppReloaded reloaded)
 {
     _urls       = urls;
     _tokenCache = tokenCache;
     _cache      = cache;
     _reloaded   = reloaded;
 }
Exemplo n.º 27
0
 public DiagnosticBehavior(IDebugReport report, IDebugDetector detector, IActionBehavior inner, IUrlRegistry urls)
 {
     _report = report;
     _detector = detector;
     _inner = inner;
     _urls = urls;
 }
Exemplo n.º 28
0
 public BootstrapAuthorizationFailureHandler(IOutputWriter writer, IRequestData requestData, IUrlRegistry urlRegistry, IHttpRequest currentHttpRequest)
 {
     _writer             = writer;
     _requestData        = requestData;
     _urlRegistry        = urlRegistry;
     _currentHttpRequest = currentHttpRequest;
 }
 public AuthenticationRequiredBehavior(ISecurityContext securityContext, IUrlRegistry urlRegistry, IOutputWriter outputWriter)
     : base(PartialBehavior.Ignored)
 {
     _securityContext = securityContext;
     _urlRegistry = urlRegistry;
     _outputWriter = outputWriter;
 }
Exemplo n.º 30
0
 public ResourceAction(ConnegActionFinder connegActionActionFinder, ActionCallMapper actionCallMapper, IUrlRegistry urlRegistry, ICurrentHttpRequest currentHttpRequest)
 {
     _connegActionActionFinder = connegActionActionFinder;
     _actionCallMapper         = actionCallMapper;
     _urlRegistry        = urlRegistry;
     _currentHttpRequest = currentHttpRequest;
 }
Exemplo n.º 31
0
 public FeedWriter(IFeedDefinition <T> definition, ILinkSource <T> links, IUrlRegistry urls, IOutputWriter writer)
 {
     _definition = definition;
     _links      = links;
     _urls       = urls;
     _writer     = writer;
 }
Exemplo n.º 32
0
 public NavigationService(BehaviorGraph graph, ICurrentHttpRequest request, IMenuStateService stateService, IUrlRegistry urls)
 {
     _request = request;
     _stateService = stateService;
     _urls = urls;
     _navigation = graph.Settings.Get<NavigationGraph>();
 }
Exemplo n.º 33
0
        public void SetUp()
        {
            urls = MockRepository.GenerateMock <IUrlRegistry>();
            page = MockRepository.GenerateMock <IFubuPage>();

            page.Stub(x => x.Urls).Return(urls);
        }
Exemplo n.º 34
0
 public BehaviorGraphWriter(BehaviorGraph graph, IUrlRegistry urls, IServiceLocator services)
 {
     _graph                = graph;
     _urls                 = urls;
     _services             = services;
     _diagnosticsNamespace = GetType().Namespace;
 }
Exemplo n.º 35
0
        public virtual HtmlDocument BuildView(IUrlRegistry urls, IOutputWriter writer, LoginRequest request)
        {
            // TODO -- Revisit all of this when we get HTML conventions everywhere
            var view = new HtmlDocument();
            var form = new FormTag(urls.UrlFor <LoginRequest>("POST"));

            form.Append(new HtmlTag("legend").Text(LoginKeys.Login));

            if (request.Message.IsNotEmpty())
            {
                form.Append(new HtmlTag("p").Text(request.Message).Style("color", "red"));
            }

            form.Append(new TextboxTag("UserName", request.UserName));
            form.Append(new TextboxTag("Password", request.Password));
            form.Append(new CheckboxTag(request.RememberMe).Name("RememberMe"));


            form.Append(new DivTag().Text(request.Message).Id("login-message"));



            form.Append(new HiddenTag().Name("Url").Attr("value", request.Url));

            form.Append(new HtmlTag("input").Attr("type", "submit").Attr("value", LoginKeys.Login).Id("login-submit"));

            view.Add(form);

            return(view);
        }
Exemplo n.º 36
0
 public GridTagWriter(IColumnPolicies policies, ITemplateWriter templates, IAssetRequirements assets, IUrlRegistry urls, T grid)
 {
     _policies  = policies;
     _templates = templates;
     _assets    = assets;
     _urls      = urls;
     _grid      = grid;
 }
 public AuthenticationRequiredBehaviour(ISecurityContext securityContext, ICurrentHttpRequest httpRequest, IUrlRegistry urlRegistry, IOutputWriter outputWriter)
     : base(PartialBehavior.Ignored)
 {
     this.securityContext = securityContext;
     this.httpRequest = httpRequest;
     this.urlRegistry = urlRegistry;
     this.outputWriter = outputWriter;
 }
 public DiagnosticBehavior(IRequestTrace trace, IDebugDetector detector, IOutputWriter writer, IExceptionHandlingObserver exceptionObserver, IUrlRegistry urls)
 {
     _trace = trace;
     _detector = detector;
     _writer = writer;
     _exceptionObserver = exceptionObserver;
     _urls = urls;
 }
Exemplo n.º 39
0
        public EmbeddedFubuMvcServer(KatanaSettings settings, IUrlRegistry urls, IServiceLocator services, IList <RouteBase> routes)
        {
            _urls     = urls;
            _services = services;

            startServer(routes, AppDomain.CurrentDomain.BaseDirectory, settings.Port);
            buildEndpointDriver(settings.Port);
        }
 public RequestLogBuilder(IUrlRegistry urls, ISystemTime systemTime, ICurrentHttpRequest request, ICurrentChain currentChain, IRequestData requestData)
 {
     _urls = urls;
     _systemTime = systemTime;
     _request = request;
     _currentChain = currentChain;
     _requestData = requestData;
 }
Exemplo n.º 41
0
 public static RouteReport ForChain(BehaviorChain chain, IUrlRegistry urls)
 {
     return(new RouteReport(chain, urls.UrlFor(new ChainRequest {
         Id = chain.UniqueId
     }), urls.UrlFor(new ChainDetailsRequest {
         Id = chain.UniqueId
     })));
 }
 public ScheduledJobsFubuDiagnostics(IUrlRegistry urls, ISchedulePersistence persistence, ChannelGraph graph, ScheduledJobGraph jobs, IScheduledJobController controller)
 {
     _urls = urls;
     _persistence = persistence;
     _graph = graph;
     _jobs = jobs;
     _controller = controller;
 }
Exemplo n.º 43
0
 public ContinuationHandler(IUrlRegistry registry, IOutputWriter writer, IFubuRequest request, IPartialFactory factory, IChainResolver resolver)
 {
     _registry = registry;
     _writer = writer;
     _request = request;
     _factory = factory;
     _resolver = resolver;
 }
Exemplo n.º 44
0
        /// <summary>
        /// Inline way to resolve a url for an input model type by defining the RouteParameters object by
        /// expressions
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="registry"></param>
        /// <param name="configure"></param>
        /// <returns></returns>
        public static string UrlFor <T>(this IUrlRegistry registry, Action <RouteParameters <T> > configure)
        {
            var parameters = new RouteParameters <T>();

            configure(parameters);

            return(registry.UrlFor <T>(parameters));
        }
Exemplo n.º 45
0
        public Link CreateLink(IUrlRegistry urls)
        {
            var url = _source(urls);
            var link = new Link(url);
            _modifications.Each(x => x(link));

            return link;
        }
Exemplo n.º 46
0
 public void SetUp()
 {
     _page = MockRepository.GenerateMock <IFubuPage>();
     _urls = MockRepository.GenerateStub <IUrlRegistry>();
     _page.Expect(p => p.Urls).Return(_urls);
     _model = new InputModel();
     _urls.Stub(u => u.UrlFor(Arg <InputModel> .Is.NotNull)).Return("some url");
 }
Exemplo n.º 47
0
        /// <summary>
        /// Inline way to resolve a url for an input model type by defining the RouteParameters object by
        /// expressions
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="registry"></param>
        /// <param name="configure"></param>
        /// <returns></returns>
        public static string UrlFor <T>(this IUrlRegistry registry, string category, Action <RouteParameters <T> > configure)
        {
            var parameters = new RouteParameters <T>();

            configure(parameters);

            return(registry.UrlFor(typeof(T), parameters, category));
        }
 public ScheduledJobsFubuDiagnostics(IUrlRegistry urls, ISchedulePersistence persistence, ChannelGraph graph, ScheduledJobGraph jobs, IScheduledJobController controller)
 {
     _urls        = urls;
     _persistence = persistence;
     _graph       = graph;
     _jobs        = jobs;
     _controller  = controller;
 }
Exemplo n.º 49
0
 public FeedWriter(IFeedSource <T> feedSource, IFeedDefinition <T> definition, ILinkSource <T> links,
                   IUrlRegistry urls)
 {
     _feedSource = feedSource;
     _definition = definition;
     _links      = links;
     _urls       = urls;
 }
Exemplo n.º 50
0
 public MediaWriter(IMediaDocument document, ILinkSource <T> links, IUrlRegistry urls,
                    IValueProjection <T> projection)
 {
     _document   = document;
     _links      = links;
     _urls       = urls;
     _projection = projection;
 }
 public MustBeAuthenticatedBehaviour(ISecurityContext securityContext, IOutputWriter writer, IUrlRegistry urls, IFubuRequest request)
     : base(PartialBehavior.Ignored)
 {
     _securityContext = securityContext;
     _writer = writer;
     _urls = urls;
     _request = request;
 }
Exemplo n.º 52
0
        public void SetUp()
        {
            graph = new DiagnosticsRegistry().BuildGraph();
            urls = MockRepository.GenerateMock<IUrlRegistry>();

            graph.Behaviors.Any().ShouldBeTrue();
            graph.Actions().Each(x => Debug.WriteLine(x.Description));
        }
Exemplo n.º 53
0
 protected override void beforeEach()
 {
     _serviceLocator = MockFor <IServiceLocator>();
     _urlRegistry    = MockFor <IUrlRegistry>();
     ClassUnderTest.ServiceLocator.ShouldBeNull();
     ClassUnderTest.ServiceLocator = _serviceLocator;
     _serviceLocator.Stub(x => x.GetInstance(typeof(IUrlRegistry))).Return(_urlRegistry);
 }
Exemplo n.º 54
0
 public ContinuationHandler(IUrlRegistry registry, IOutputWriter writer, IFubuRequest request, IPartialFactory factory, IChainResolver resolver)
 {
     _registry = registry;
     _writer   = writer;
     _request  = request;
     _factory  = factory;
     _resolver = resolver;
 }
Exemplo n.º 55
0
 public EntityCreator(INewEntityHandler <TEdit> newEntityHandler, IEntitySaver <TEntity> saver, IValidator validator, IUrlRegistry urls, IFlattener flattener)
 {
     _newEntityHandler = newEntityHandler;
     _saver            = saver;
     _validator        = validator;
     _urls             = urls;
     _flattener        = flattener;
 }
 public ValidationContinuationHandler(IUrlRegistry registry, IOutputWriter writer, IFubuRequest request,
     IPartialFactory factory)
 {
     _registry = registry;
     _writer = writer;
     _request = request;
     _factory = factory;
 }
        public void SetUp()
        {
            _page = MockRepository.GenerateMock<IFubuPage>();
            _urls = new StubUrlRegistry();

            _page.Expect(p => p.Urls).Return(_urls);
            _model = new InputModel();
            //_urls.Stub(u => u.UrlFor(Arg<InputModel>.Is.NotNull)).Return("some url");
        }
Exemplo n.º 58
0
        public DiagnosticBehavior(IDebugReport report, IDebugDetector detector, IUrlRegistry urls,
            IRequestHistoryCache history)
        {
            _report = report;
            _detector = detector;
            _urls = urls;

            history.AddReport(report);
        }
Exemplo n.º 59
0
        public ExampleHtmlWriter(IServiceLocator serviceLocator, IUrlRegistry urlRegistry, BehaviorGraph behaviorGraph, ICurrentHttpRequest httpRequest)
        {
            _serviceLocator = serviceLocator;
            _urlRegistry = urlRegistry;
            _behaviorGraph = behaviorGraph;
            _httpRequest = httpRequest;

            _examplePageUrl = httpRequest.ToFullUrl("_fubu/html/example");
        }
Exemplo n.º 60
0
 public MustBeAuthorizedBehavior(ActionCall actionCall, ISecurityContext securityContext, IUrlRegistry urls, IFubuRequest request, IOutputWriter writer)
     : base(PartialBehavior.Ignored)
 {
     _actionCall = actionCall;
     _securityContext = securityContext;
     _urls = urls;
     _request = request;
     _writer = writer;
 }