예제 #1
0
 protected override void configureObject(ObjectDef def)
 {
     def.Child(new ViewPath
     {
         ViewName = _viewName
     });
 }
예제 #2
0
 protected override void configureObject(ObjectDef def)
 {
     def.Child(new ViewPath
     {
         ViewName = _viewName
     });
 }
예제 #3
0
        public void build_an_object_with_dependencies()
        {
            var request = new InMemoryFubuRequest();


            var def = new ObjectDef(typeof(FakeJsonBehavior));

            def.Child(typeof(IFubuRequest), request);
            var jsonWriter = def.Child(typeof(IJsonWriter), typeof(AjaxAwareJsonWriter));

            jsonWriter.Child(typeof(IOutputWriter), typeof(HttpResponseOutputWriter));
            jsonWriter.Child(typeof(IRequestData), typeof(InMemoryRequestData));
            def.Child(typeof(IRequestData), typeof(InMemoryRequestData));

            var container =
                new Container(x => { x.For <IActionBehavior>().Use(new ObjectDefInstance(def)); });

            var jsonBehavior = container.GetInstance <IActionBehavior>().ShouldBeOfType <FakeJsonBehavior>();

            jsonBehavior.Writer.ShouldBeOfType <AjaxAwareJsonWriter>();
            jsonBehavior.Request.ShouldBeTheSameAs(request);
        }
        protected override void configureObject(ObjectDef def)
        {
            ObjectDef currentCandidate = null;
            foreach (var pair in _outputs.Reverse())
            {
                var candidate = new ObjectDef(typeof(ConditionalOutput));
                candidate.Child(typeof(Func<OutputFormatDetector, bool>), pair.Predicate);
                candidate.Dependencies.Add(new ConfiguredDependency { Definition = pair.OutputNode.ToObjectDef(), DependencyType = typeof(IActionBehavior) });
                if (currentCandidate != null)
                {
                    candidate.Dependencies.Add(new ConfiguredDependency { Definition = currentCandidate, DependencyType = typeof(ConditionalOutput) });
                }
                currentCandidate = candidate;
            }

            def.Dependencies.Add(new ConfiguredDependency { Definition = currentCandidate, DependencyType = typeof(ConditionalOutput) });
        }
예제 #5
0
 protected override void configureObject(ObjectDef def)
 {
     def.Child(_viewToken);
     def.Child(_actionCall);
 }
예제 #6
0
 protected override void configureObject(ObjectDef def)
 {
     def.Child(MimeType);
 }
예제 #7
0
 protected override void configureObject(ObjectDef def)
 {
     def.Child(_viewToken);
     def.Child(_actionCall);
 }