示例#1
0
 public ObjectResolver(IServiceLocator services, BindingRegistry binders, IBindingLogger logger)
 {
     _services       = services;
     _binders        = binders;
     _logger         = logger;
     _propertySetter = binders.PropertySetter;
 }
示例#2
0
        public SimpleExecutionContext()
        {
            Services = new InMemoryServiceLocator();
            BindingRegistry = new BindingRegistry();

            var stringifier = new Stringifier();
            Services.Add(stringifier);
        }
示例#3
0
        public FubuMvcContext(IApplicationUnderTest application, BindingRegistry binding, IEnumerable<IContextualInfoProvider> contextualProviders )
        {
            _application = application;
            _binding = binding;

            _contextualProviders = contextualProviders ?? new IContextualInfoProvider[0];

            _contextualProviders.Each(x => x.Reset());
        }
        public void can_write_out_binding_registry_description()
        {
            var bindingRegistry = new BindingRegistry();
            bindingRegistry.Add(new FakeModelBinder());

            var description = Description.For(bindingRegistry);
            var writer = new DescriptionTextWriter(description);

            Debug.WriteLine(writer.ToString());
        }
示例#5
0
        public static IObjectBlockReader Reader()
        {
            var registry = new BindingRegistry();
            registry.Add(new VersionConstraintConverter());
            registry.Add(new GroupedDependencyConverter());

            var services = new InMemoryServiceLocator();
            var resolver = new ObjectResolver(services, registry, new NulloBindingLogger());

            services.Add<IObjectResolver>(resolver);

            return new ObjectBlockReader(new ObjectBlockParser(), resolver, services, new RippleBlockRegistry());
        }
示例#6
0
        public void SetUp()
        {
            _registry = new BindingRegistry();
            _property = typeof (PropertyHolder).GetProperty("Property");
            _numericTypeFamily = _registry.AllConverterFamilies().FirstOrDefault(cf =>
                                                                   cf.Matches(_property)) as NumericTypeFamily;
            _numericTypeFamily.ShouldNotBeNull();

            _context = MockRepository.GenerateMock<IPropertyContext>();
            _context.Stub(x => x.Property).Return(_property);
            _propertyValue = new BindingValue { RawValue = "1.000,001" };
            _context.Expect(c => c.RawValueFromRequest).Return(_propertyValue).Repeat.Times(4);
        }
 public StandardModelBinder(BindingRegistry propertyBinders, ITypeDescriptorCache typeCache)
 {
     _propertyBinders = propertyBinders;
     _typeCache = typeCache;
 }
示例#8
0
 public FubuMvcContext(IApplicationUnderTest application, BindingRegistry binding)
 {
     _application = application;
     _binding = binding;
 }
示例#9
0
        private IApplicationUnderTest buildApplication()
        {
            FubuMvcPackageFacility.PhysicalRootPath = _settings.PhysicalPath;
            var runtime = _runtimeSource();
            var application = _hosting.Start(_settings, runtime, WebDriverSettings.GetBrowserLifecyle());

            _binding = application.Services.GetInstance<BindingRegistry>();
            configureApplication(application, _binding);

            runtime.Facility.Register(typeof(IApplicationUnderTest), ObjectDef.ForValue(application));

            return application;
        }
示例#10
0
 protected virtual void configureApplication(IApplicationUnderTest application, BindingRegistry binding)
 {
 }
示例#11
0
 public StandardModelBinder(BindingRegistry propertyBinders, ITypeDescriptorCache typeCache)
 {
     _propertyBinders = propertyBinders;
     _typeCache       = typeCache;
 }
 public ModelBindingFubuDiagnostics(BindingRegistry bindingRegistry)
 {
     _bindingRegistry = bindingRegistry;
 }
 public ModelBindingEndpoints(BindingRegistry bindingRegistry, IVisualizer visualizer)
 {
     _bindingRegistry = bindingRegistry;
     _visualizer = visualizer;
 }
        public void SetUp()
        {
            theRegistry = new BindingRegistry();
            var binder = new ConversionPropertyBinder(theRegistry);
            theDescription = Description.For(binder);

            theConversionList = theDescription.BulletLists.Single();
        }
 public void SetUp()
 {
     var registry = new BindingRegistry();
     registry.Add(new FakeModelBinder());
     theDescription = Description.For(registry);
 }
        public void SetUp()
        {
            theRegistry = new BindingRegistry();
            theDescription = Description.For(theRegistry).BulletLists.Single().Children.Single();

            thePropertyBinderList = theDescription.BulletLists.Single();
        }