Ejemplo n.º 1
0
        public void SetUp()
        {
            var theHttpRequest = new CurrentChain(new BehaviorChain(), new Dictionary <string, object>());

            theExpectedHash = ResourceHash.For(theHttpRequest);

            FubuApplication.SetupNamingStrategyForHttpHeaders();

            theEtagRequest = BindingScenario <ETaggedRequest> .Build(x =>
            {
                x.Service <ICurrentChain>(theHttpRequest);
                x.Data("If-None-Match", "12345");
            });
        }
        public void SetUp()
        {
            var theHttpRequest = MockRepository.GenerateMock <ICurrentChain>();

            theHttpRequest.Stub(x => x.ResourceHash()).Return("something/else");

            var locator = new StructureMapServiceLocator(new Container(x =>
            {
                x.For <ICurrentChain>().Use(theHttpRequest);
            }));

            FubuApplication.SetupNamingStrategyForHttpHeaders();

            var data = new InMemoryRequestData();

            data["If-None-Match"] = "12345";

            var context = new BindingContext(data, locator, new NulloBindingLogger());

            var binder = StandardModelBinder.Basic();

            theEtagRequest = binder.Bind(typeof(ETaggedRequest), context).As <ETaggedRequest>();
        }