Example #1
0
        public void FromRouteSetsParameterName()
        {
            Expression <Func <TestController, string> > expression = c => c.TestMethod(From.Route <string>("somename"));

            var methodCall = RouteHelper.GetInnerMethodCallExpression(expression);

            var routeParameters = RouteHelper.GetRouteParameters(methodCall);

            var routeParameter = Assert.Single(routeParameters);

            Assert.Equal("somename", routeParameter.declaration.ModelName);
        }
Example #2
0
        public void FromFormSetsParameterNameWithoutOverride()
        {
            Expression <Func <TestController, string> > expression = c => c.TestMethod(From.Form <string>());

            var methodCall = RouteHelper.GetInnerMethodCallExpression(expression);

            var routeParameters = RouteHelper.GetRouteParameters(methodCall);

            var routeParameter = Assert.Single(routeParameters);

            Assert.Null(routeParameter.declaration.ModelName);
        }