I am writing a TestClass let's say "ServiceTest
" which has a property called ExampleService
public IService ExampleService { get; set;}
I am using the ExampleService inside my test method and invoking some operations on it. I need to instantiate the IService using spring.config. But as it is a Test class I do not want to create instance of ServiceTest inside my spring config. I know how to do that using tag.
<object id="MyService" type="MyTestProject.ServiceTest, MyTestProject">
<property name="ExampleService " ref="SomeAssembly.ServiceClass"/>
</object>
But I just want to set the value of ExampleService in my app.config so that it gets instantiated and set for the variable ExampleService
.
How can I do this?