public void no_custom_resource_not_found_handler() { var node = new OutputNode(typeof(Address)); var def = node.As <IContainerModel>().ToInstance().As <IConfiguredInstance>(); def.FindDependencyDefinitionFor <IResourceNotFoundHandler>() .ShouldBeNull(); }
public void no_custom_resource_not_found_handler() { var node = new OutputNode(typeof(Address)); var def = node.As <IContainerModel>().ToObjectDef(); def.DependencyFor <IResourceNotFoundHandler>() .ShouldBeNull(); }
public void add_a_custom_no_resource_handler() { var node = new OutputNode(typeof(Address)); node.UseForResourceNotFound <MyFakeResourceNotHandler>(); var def = node.As <IContainerModel>().ToInstance().As <IConfiguredInstance>(); def.FindDependencyDefinitionFor <IResourceNotFoundHandler>() .ReturnedType.ShouldBe(typeof(MyFakeResourceNotHandler)); }
public void add_a_custom_no_resource_handler() { var node = new OutputNode(typeof(Address)); node.UseForResourceNotFound <MyFakeResourceNotHandler>(); var def = node.As <IContainerModel>().ToObjectDef(); def.FindDependencyDefinitionFor <IResourceNotFoundHandler>() .Type.ShouldEqual(typeof(MyFakeResourceNotHandler)); }
public void SetUp() { var node = new OutputNode(typeof(Address)); node.Add(new NewtonsoftJsonFormatter()); node.Add(new XmlFormatter()); node.Add(new FakeAddressWriter()); using (var runtime = FubuRuntime.Basic()) { var container = runtime.Get <IContainer>(); container.Configure(x => { // Need a stand in value x.For <IHttpRequest>().Use(MockRepository.GenerateMock <IHttpRequest>()); }); theInputBehavior = container.GetInstance <OutputBehavior <Address> >(node.As <IContainerModel>().ToInstance()); } }
public void implements_the_IMayHaveResourceType_interface() { var node = new OutputNode(typeof(Address)); node.As <IMayHaveResourceType>().ResourceType().ShouldEqual(node.ResourceType); }
public void implements_the_IMayHaveResourceType_interface() { var node = new OutputNode(typeof(Address)); node.As<IMayHaveResourceType>().ResourceType().ShouldEqual(node.ResourceType); }