Exemple #1
0
        public void should_populate_fullurl_from_current_http_request()
        {
            var stubCurrentHttpRequest = new StubCurrentHttpRequest();
            var model =
                BindingScenario <FullUrlModel> .For(x =>
            {
                x.BindPropertyWith <CurrentRequestFullUrlPropertyBinder>(f => f.FullUrl);
                x.Service <ICurrentHttpRequest>(stubCurrentHttpRequest);
            })
                .Model;

            model.FullUrl.ShouldEqual(stubCurrentHttpRequest.FullUrl());
        }
        public void SetUp()
        {
            httpRequest = new StubCurrentHttpRequest();

            var container = StructureMapContainerFacility.GetBasicFubuContainer();

            theHeaderValues = httpRequest.Headers;


            container.Inject <ICurrentHttpRequest>(httpRequest);

            theHeaders = container.GetInstance <RequestHeaders>();
        }
        public void should_populate_relativeurl_from_current_http_request()
        {
            var stubCurrentHttpRequest = new StubCurrentHttpRequest {
                TheRelativeUrl = "~/foo"
            };
            var model =
                BindingScenario <RelativeUrlModel> .For(x =>
            {
                x.BindPropertyWith <CurrentRequestRelativeUrlPropertyBinder>(f => f.RelativeUrl);
                x.Service <ICurrentHttpRequest>(stubCurrentHttpRequest);
            })
                .Model;

            model.RelativeUrl.ShouldEqual(stubCurrentHttpRequest.RelativeUrl());
        }
Exemple #4
0
        public void SetUp()
        {
            graph = BehaviorGraph.BuildFrom(x =>
            {
                x.Actions.FindBy(source => {
                    source.IncludeTypesNamed(n => n.StartsWith("UrlCategory"));
                });
            });

            var request = new StubCurrentHttpRequest {
                TheApplicationRoot = "http://server/app"
            };
            var urlResolver = new ChainUrlResolver(request);

            registry = new UrlRegistry(new ChainResolutionCache(new TypeResolver(), graph), urlResolver, new JQueryUrlTemplate(), request);
        }
Exemple #5
0
 public void SetUp()
 {
     theRequest = new StubCurrentHttpRequest();
     theCookies = new Core.Http.Cookies.Cookies(theRequest);
 }
Exemple #6
0
 public void SetUp()
 {
     theRequest = new StubCurrentHttpRequest();
     theSource  = new HeaderValueSource(theRequest);
 }