c# - Disable dependency checking for TestContext -
i have created mstest using spring. in test use testcontext.
[testclass] public class test : abstractdependencyinjectionspringcontexttests { [testmethod] public void test() { } protected override string[] configlocations { { return new string[] { "~/configuration/spring.config"}; } } public testcontext testcontext { get; set; } } when run test following error:
unsatisfied dependency expressed through object property 'testcontext': set property value or disable dependency checking object..
how can disable dependency injection testcontext property?
by default spring.net uses autowire type populate properties on testclasses; iirc can override forcing field level injection. might find earlier answer of mine useful when configuring field level injection on tests. think way go in case.
disabling dependency checking testcontext property require configuring test class, defeat purpose of using abstractdependencyinjectionspringcontexttests in first place. think normal autowire message that's misleading in context of integration testing.
you can opt not use dependency injection @ not inheriting abstractdependencyinjectionspringcontexttests, base classabstractspringcontexttests; has downside of not doing injection @ all.
Comments
Post a Comment