public void for_intput_with_model()
        {
            var key   = StringToken.FromKeyString("Something");
            var input = new FakeInput()
            {
                Name = "something"
            };
            var node = MenuNode.ForInput(key, input);

            node.UrlInput.ShouldBeTheSameAs(input);

            var chain1 = new BehaviorChain();

            chain1.AddToEnd(ActionCall.For <FakeController>(x => x.FromInput(null)));
            chain1.Route = new RouteDefinition("something");
            chain1.Route.AddHttpMethodConstraint("GET");

            var chain2 = new BehaviorChain();

            chain2.AddToEnd(ActionCall.For <FakeController>(x => x.FromInput(null)));
            chain2.Route = new RouteDefinition("something");
            chain2.Route.AddHttpMethodConstraint("POST");

            resolve(node, graph =>
            {
                graph.AddChain(chain1);
                graph.AddChain(chain2);
            });

            node.BehaviorChain.ShouldBeTheSameAs(chain1);
        }
Ejemplo n.º 2
0
        public void create_for_input_where_it_is_null()
        {
            var key  = StringToken.FromKeyString("Something");
            var node = MenuNode.ForInput <FakeInput>(key);

            node.UrlInput.ShouldBeNull();

            var chain1 = new RoutedChain("something");

            chain1.AddToEnd(ActionCall.For <FakeController>(x => x.FromInput(null)));
            chain1.Route.AddHttpMethodConstraint("GET");

            var chain2 = new RoutedChain("something");

            chain2.AddToEnd(ActionCall.For <FakeController>(x => x.FromInput(null)));
            chain2.Route.AddHttpMethodConstraint("POST");

            resolve(node, graph =>
            {
                graph.AddChain(chain1);
                graph.AddChain(chain2);
            });

            node.BehaviorChain.ShouldBeTheSameAs(chain1);
        }
        public void create_for_input_with_lamba()
        {
            var key  = StringToken.FromKeyString("Something");
            var node = MenuNode.ForInput <FakeInput>(key, x => x.Category = "Test");

            node.Category.ShouldEqual("Test");
        }
Ejemplo n.º 4
0
        public FubuMVCWorldMenu()
        {
            ForMenu(FubuWorldKeys.Main);
            var mvc = MenuNode.ForInput <FubuMVCHomeInput>(FubuMVCWorldKeys.MvcHome);

            configureChildren(mvc);
            Add += mvc;
        }
Ejemplo n.º 5
0
        public ArticleNavigationRegistry()
        {
            ForMenu(StringConstants.BlogName);
            Add += MenuNode.ForInput <ArticleSummariesInputModel>("Home");
            InsertAfter["Home"] = MenuNode.ForInput <ArchiveInputModel>("Archive");

            ForMenu(StringConstants.AdminMenu);
            Add += MenuNode.ForInput <ComposeInputModel>("Compose");
            Add += MenuNode.ForInput <ManageArticlesInputModel>("Articles");
        }
Ejemplo n.º 6
0
        public AuthorizationNavigationRegistry()
        {
            var loginMenu = MenuNode.ForInput <LoginInputModel>("Login");

            loginMenu.HideIf <AuthorizedConditional>();

            var logoutMenu = MenuNode.ForInput <LogoutInputModel>("Logout");

            logoutMenu.HideIf <NotAuthorizedConditional>();

            ForMenu(StringConstants.BlogName);

            InsertAfter["About"] = loginMenu;
            InsertAfter["About"] = logoutMenu;
        }
        public DiagnosticsMenu()
        {
            ForMenu(DiagnosticKeys.Main);

            Add += MenuNode.ForInput <PackageDiagnosticsRequestModel>(DiagnosticKeys.ApplicationStartup);

            Add += MenuNode.ForAction <RequestsEndpoint>(DiagnosticKeys.Requests, x => x.get_requests());
            Add += MenuNode.ForInput <RoutesRequest>(DiagnosticKeys.Endpoints);

            Add += MenuNode.ForAction <ModelBindingEndpoints>(DiagnosticKeys.ModelBindingExplorer, x => x.get_binding_all());


            Add += MenuNode.Node(DiagnosticKeys.Services);
            ForMenu(DiagnosticKeys.Services);

            Add += MenuNode.ForAction <ServiceEndpoints>(DiagnosticKeys.ServicesByName, x => x.get_services_byname());
            Add += MenuNode.ForAction <ServiceEndpoints>(DiagnosticKeys.ServicesBySource, x => x.get_services_bysource());
        }
Ejemplo n.º 8
0
 public InformationNavigationRegistry()
 {
     ForMenu(StringConstants.BlogName);
     InsertAfter["Archive"] = MenuNode.ForInput <AboutInputModel>("About");
 }
Ejemplo n.º 9
0
 public ProfileNavigationRegistry()
 {
     ForMenu(StringConstants.ProfileMenu);
     Add += MenuNode.ForInput <DashboardInputModel>("Dashboard");
     Add += MenuNode.ForInput <BasicInformationInputModel>("Profile");
 }
Ejemplo n.º 10
0
 private void configureChildren(MenuNode parent)
 {
     parent.AddChild(MenuNode.ForInput <MvcGettingStarted>(FubuMVCWorldKeys.GettingStarted));
 }
Ejemplo n.º 11
0
 public FubuMVCWorldMenu()
 {
     ForMenu(FubuWorldKeys.Main);
     Add += MenuNode.ForInput <FubuMVCHomeInput>(FubuMVCWorldKeys.MvcHome);
 }
Ejemplo n.º 12
0
 public PagesNavigationRegistry()
 {
     ForMenu(StringConstants.ProfileMenu);
     InsertAfter["Dashboard"] = MenuNode.ForInput <ManagePagesInputModel>("Pages");
 }
Ejemplo n.º 13
0
 public SetttingsNavigationRegistry()
 {
     ForMenu(StringConstants.ProfileMenu);
     Add += MenuNode.ForInput <SettingsInputModel>("Settings");
 }
Ejemplo n.º 14
0
 public CommentsNavigationRegistry()
 {
     ForMenu(StringConstants.AdminMenu);
     Add += MenuNode.ForInput <ManageCommentsInputModel>("Comments");
 }
 public VisualizationsMenu()
 {
     ForMenu(DiagnosticKeys.Main);
     Add += MenuNode.ForInput <VisualizationRequest>(VisualizationKeys.Main);
 }