开发者

Passing data around in a custom NUnit test runner

开发者 https://www.devze.com 2023-02-15 20:41 出处:网络
I\'m attempting to write a custom NUnit test runner to integrate into our application and I\'ve managed to get a TestRunner object created and running some test开发者_如何学Pythons. Next I would like

I'm attempting to write a custom NUnit test runner to integrate into our application and I've managed to get a TestRunner object created and running some test开发者_如何学Pythons. Next I would like to be able to pass some data into the TestRunner for the tests to use.

At the moment I have created a class that implements IService and I add an instance into the NUnit ServiceManager class. A setup method, test method, etc, then uses the ServiceManager.Services to locate the object and can then access the data.

This seems to work, but I was wondering if this is the correct way to do this. Are there any easier/simplier/better ways of doing this and what gotchas should I look out for?

Kind Regards

Michael

0

精彩评论

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

关注公众号