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); }
public string FromInput(FakeInput input) { return input.Name; }
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); }
public string FromInput(FakeInput input) { return(input.Name); }