简体   繁体   English

运行Nunit预编译测试

[英]Run Nunit precompiled test

I have a project containing Nunit test. 我有一个包含Nunit测试的项目。

I have the code project with all interfaces implemented but no code. 我的代码项目实现了所有接口,但没有代码。 All function throws exceptions. 所有函数都会引发异常。

My gol is to give someone else the implemntation of the code. 我的目标是给他人代码的暗示。 His job will be done when the all tests will be green. 当所有测试变为绿色时,将完成他的工作。

What I'd like is to give him the test cases (nunit) to be able to run them.ì, but not the inner code of the tests. 我想要给他测试用例(nunit)以便能够运行它们。ì,而不是测试的内部代码。

I had 2 ideas : 我有两个想法:

  • password lock the nunit project. 密码锁定nunit项目。
  • precompile the nunit project 预编译nunit项目

I couldn't figure out how to implement neither one of the two. 我不知道如何实现两者之一。

Anyone has an advice on how to rach my goal? 有人对如何实现我的目标有建议吗?

Thanks 谢谢

Perhaps an easy way is to put the unit tests on a continuous integration (CI) server (eg Jenkins; TeamCity) and only on the CI server that during a check-in of code runs the unit tests over his code. 也许一种简单的方法是将单元测试放在持续集成 (CI)服务器(例如Jenkins; TeamCity)上,并且仅放在在代码检入期间对其代码进行单元测试的CI服务器上。 You could if you like, put the source code for the nUnit tests elsewhere in SCM or deny access to it if there is a security requirement which you hinted at. 您可以根据需要将nUnit测试的源代码放在SCM中的其他位置,或者在提示安全性要求时拒绝对其进行访问。 That may be suitable perhaps? 那也许合适吗?

His job will be done when the all tests will be green 当所有测试都变成绿色时,他的工作就完成了

That can be performed by opening the CI tool of your choice and examining the dashboard for "green lights". 这可以通过打开所选的CI工具并检查仪表板上的“绿灯”来执行。

That way the developer never actually sees the tests, code or otherwise. 这样,开发人员实际上不会看到测试,代码或其他内容。 They can just focus on developing their code. 他们可以只专注于开发代码。 This can be beneficial for those teams where there are distinct developers and testers. 对于那些拥有不同开发人员和测试人员的团队来说,这可能是有益的。

No need to password-lock nor pre-compile the library, because the developer never makes use of it, only the CI server which you can deploy to by a suitable means. 无需密码锁定或预编译库,因为开发人员从不使用它,仅需使用适当的方法将其部署到的CI服务器即可。

Hope this is suitable. 希望这是合适的。

EDIT: Upon learning this is actually a class-room setting, setting up a CI server may be slight over-kill. 编辑:得知这实际上是一个教室设置后,设置CI服务器可能会有点过分。 Perhaps just compile the nUnit tests into a .dll and hand-out to your students to run with the nUnit GUI ? 也许只是将nUnit测试编译为.dll并分发给学生以使用nUnit GUI运行?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM