configuration/tests/ConfigFiles/MethodInjection.config

72 строки
2.7 KiB
XML

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="unity" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection, Unity.Configuration"/>
</configSections>
<unity>
<aliases>
<add alias="object" type="System.Object, mscorlib" />
<add alias="int" type="System.Int32, mscorlib" />
<add alias="string" type="System.String, mscorlib" />
<add alias="ILogger" type="Microsoft.Practices.Unity.TestSupport.ILogger, Configuration.Tests" />
<add alias="MockLogger" type="Microsoft.Practices.Unity.TestSupport.MockLogger, Configuration.Tests" />
<add alias="ObjectWithInjectionMethod" type="Microsoft.Practices.Unity.TestSupport.ObjectWithInjectionMethod, Configuration.Tests" />
<add alias="ObjectWithOverloads" type="Microsoft.Practices.Unity.Configuration.Tests.TestObjects.ObjectWithOverloads, Configuration.Tests" />
</aliases>
<container>
<instance type="string" name="northwind" value="northwind" />
<register type="ILogger" mapTo="MockLogger" />
<register type="ObjectWithInjectionMethod" name="singleMethod">
<method name="Initialize">
<param name="connectionString" dependencyName="northwind" />
<param name="logger" />
</method>
</register>
<register type="ObjectWithInjectionMethod" name="twoMethods">
<method name="Initialize">
<param name="connectionString" dependencyName="northwind" />
<param name="logger" />
</method>
<method name="MoreInitialization">
<param name="data" />
</method>
</register>
<register type="ObjectWithOverloads" name="callFirstOverload">
<method name="CallMe">
<param name="param" type="int" value="17"/>
</method>
</register>
<register type="ObjectWithOverloads" name="callSecondOverload">
<method name="CallMe">
<param name="param" type="string" dependencyName="northwind"/>
</method>
</register>
<register type="ObjectWithOverloads" name="callBothOverloads">
<method name="CallMe">
<param name="param" type="int" value="17" />
</method>
<method name="CallMe">
<param name="param" type="string" value="some string" />
</method>
</register>
<register type="ObjectWithOverloads" name="callFirstOverloadTwice">
<method name="CallMe">
<param name="param" type="int" value="17" />
</method>
<method name="CallMe">
<param name="param" type="int" value="35" />
</method>
</register>
</container>
</unity>
</configuration>