开发者

NUnit integration programmatically with spring

I have a component based architecture framework designed and I use NUnit for isolated testing - okay so far.

Now I want to enable integration tests. Therefore the tests use real implementations of the existing components.

Each element of the component has a life cycle (init, start and stop) and I created a NUnit component. In the start section the Console runner of the NUnit will be executed.

Okay - now if I have a test fixture class in my dlls in the execution path the runner exectues them - fine!

But: And this is crucial! Each to be tested implementation exists so far in the process and I want to use this instances for testing. If I use NUnit runner in the current way each instance will be created twice - and above all: I have a spring container and a implementation registry. Via this registry I can get access to all instances in the processes. But how do I give the test fixture access to the existing registry?

Good: I can start the component architec开发者_JAVA技巧ture framework in the startup of the nunit runner - but this is not what I want.

My guide is the apache Cactus framework (with JUnit and tomcat, JBoss etc.)

Can someone help?

Thanks a lot!


Check: http://cone.codeplex.com


Have you thought about using spring.net's integration testing support? It can manage contexts, inject objects into your tests and even rollback database transactions started as part of a test. By default your configuration is reused across tests within a fixture.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜