public void should_have_one_default_value_for_a_route_and_does_not_include_querystring_in_route()
        {
            var url = new RouteDefinition<SampleViewModel>("my/sample");
            url.AddRouteInput(x => x.InPath);
            url.AddQueryInput(x => x.InQueryString);
            url.RouteInputFor("InPath").DefaultValue = "something";
            url.QueryInputFor("InQueryString").DefaultValue = "querysomething";
            Route route = url.ToRoute();

            route.Defaults.Count().ShouldEqual(1);
        }
        public void create_url_with_variables_in_querystring()
        {
            var url = new RouteDefinition<SampleViewModel>("/my/sample/path");
            url.AddQueryInput(x => x.InQueryString);

            url.CreateUrl(new SampleViewModel
            {
                InQueryString = "query"
            }).ShouldEqual("/my/sample/path?InQueryString=query");
        }
        public void create_url_with_variables_in_querystring_with_parameters()
        {
            var url = new RouteDefinition<SampleViewModel>("/my/sample/path");
            url.AddQueryInput(x => x.InQueryString);

            var parameters = new RouteParameters<SampleViewModel>();
            parameters[x => x.InQueryString] = "query";

            url.CreateUrlFromParameters(parameters).ShouldEqual("/my/sample/path?InQueryString=query");
        }
        public void create_url_with_querystring_and_inputmodel()
        {
            var url = new RouteDefinition<SampleViewModel>("test/edit/{InPath}");
            url.AddRouteInput(x => x.InPath);
            url.AddQueryInput(x => x.InQueryString);

            url.CreateUrl(new SampleViewModel
            {
                InPath = "5",
                InQueryString = "query"
            }).ShouldEqual("/test/edit/5?InQueryString=query");
        }
        public void create_url_with_querystring_and_inputmodel_with_parameters()
        {
            var url = new RouteDefinition<SampleViewModel>("test/edit/{InPath}");
            url.AddRouteInput(x => x.InPath);
            url.AddQueryInput(x => x.InQueryString);

            var parameters = new RouteParameters<SampleViewModel>();
            parameters[x => x.InPath] = "5";
            parameters[x => x.InQueryString] = "query";

            url.CreateUrlFromParameters(parameters).ShouldEqual("test/edit/5?InQueryString=query");
        }