Ejemplo n.º 1
0
        public void SetUp()
        {
            binder = (StandardModelBinder)StandardModelBinder.Basic();

            context = new InMemoryBindingContext();

            result = null;
        }
Ejemplo n.º 2
0
        public void SetUp()
        {
            using (var writer = new StreamWriter("flatfile.txt"))
            {
                writer.WriteLine("A|B|C|D");
                writer.WriteLine("a0|b0|c0|d0");
                writer.WriteLine("a1|b1|c1|d1");
                writer.WriteLine("a2|b2|c2|d2");
            }

            reader = new FlatFileReader <FlatFileReaderTarget>(StandardModelBinder.Basic(), new StubServiceLocator());
        }
Ejemplo n.º 3
0
        public void should_log_model_binder_usage()
        {
            var theModelBinder = StandardModelBinder.Basic();

            MockFor <IModelBinderCache>()
            .Expect(c => c.BinderFor(typeof(SimpleModel)))
            .Return(theModelBinder);

            MockFor <IDebugReport>()
            .Expect(r => r.AddBindingDetail(new ModelBinderSelection
            {
                BinderType = typeof(StandardModelBinder),
                ModelType  = typeof(SimpleModel)
            }));

            ClassUnderTest.ChoseModelBinder(typeof(SimpleModel), theModelBinder);

            VerifyCallsFor <IDebugReport>();
        }
Ejemplo n.º 4
0
        public void SetUp()
        {
            theBinder = StandardModelBinder.Basic().As <StandardModelBinder>();

            theAggregateDictionary = new AggregateDictionary();

            var otherDictionary = new Dictionary <string, object>();

            for (int i = 0; i < 10; i++)
            {
                otherDictionary.Add("Part" + i, Guid.NewGuid().ToString());
            }

            theAggregateDictionary.AddDictionary(RequestDataSource.Request.ToString(), otherDictionary);


            theRouteValues = new Dictionary <string, object>();

            theAggregateDictionary.AddDictionary(RequestDataSource.Route.ToString(), theRouteValues);
        }
        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>();
        }
Ejemplo n.º 6
0
 public void SetUp()
 {
     binder = new ReaderBinder(StandardModelBinder.Basic(), new StubServiceLocator());
 }