本文整理汇总了C#中WindsorContainer.BuildUp方法的典型用法代码示例。如果您正苦于以下问题:C# WindsorContainer.BuildUp方法的具体用法?C# WindsorContainer.BuildUp怎么用?C# WindsorContainer.BuildUp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WindsorContainer
的用法示例。
在下文中一共展示了WindsorContainer.BuildUp方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Should_Return_Null_When_Type_Is_Not_Instantiated
public void Should_Return_Null_When_Type_Is_Not_Instantiated()
{
var container = new WindsorContainer();
container.Register(Component.For<IPerson>().ImplementedBy<PersonA>());
TestClass instance = null;
Assert.IsNull(container.BuildUp(instance));
}
开发者ID:kalyanraman,项目名称:WebApiContrib.IoC.CastleWindsor,代码行数:9,代码来源:WindsorContainerBuildUpExtensionTests.cs
示例2: Should_Not_Inject_Dependency_When_Injected_Property_Is_Instantiated
public void Should_Not_Inject_Dependency_When_Injected_Property_Is_Instantiated()
{
var container = new WindsorContainer();
container.Register(Component.For<IPerson>().ImplementedBy<PersonA>());
var instance = new TestClass() { Person = new PersonB() };
container.BuildUp(instance);
Assert.IsInstanceOf<PersonB>(instance.Person);
}
开发者ID:kalyanraman,项目名称:WebApiContrib.IoC.CastleWindsor,代码行数:11,代码来源:WindsorContainerBuildUpExtensionTests.cs
示例3: Should_Not_Inject_Dependency_When_Property_Is_Not_Decorated_With_Dependency_Attribute
public void Should_Not_Inject_Dependency_When_Property_Is_Not_Decorated_With_Dependency_Attribute()
{
var container = new WindsorContainer();
container.Register(Component.For<IPerson>().ImplementedBy<PersonA>());
var instance = new TestClass() { Person = new PersonB() };
container.BuildUp(instance);
Assert.IsNull(instance.AnotherPerson);
}
开发者ID:kalyanraman,项目名称:WebApiContrib.IoC.CastleWindsor,代码行数:11,代码来源:WindsorContainerBuildUpExtensionTests.cs
示例4: Should_Inject_Dependency
public void Should_Inject_Dependency()
{
var container = new WindsorContainer();
container.Register(Component.For<IPerson>().ImplementedBy<PersonA>());
var instance = new TestClass();
container.BuildUp(instance);
Assert.IsInstanceOf<PersonA>(instance.Person);
}
开发者ID:kalyanraman,项目名称:WebApiContrib.IoC.CastleWindsor,代码行数:11,代码来源:WindsorContainerBuildUpExtensionTests.cs