简体   繁体   中英

Is this possible in NUnit

What i want is a project with several files in it. Each file has a set of tests. Then I want to be able to run each of those tests.

So right now I have a project but I only have one file: Project.cs. When i run the test through the console/GUI All them tests from Project.cs are run (or a subset if i use the /fixture command). What I would like (or would like to know if its possible) would be the following.

Have a Project called Tests. In that I have several files FileTests.cs, ControlTests.cs, MiscTests.cs, etc each of these have various tests. Then there is also a Program.cs. I would be able to run the Tests project and choose which of the FileTests, ControlTests, etc I run.

Is that possible?

Cheers

Sounds like you are looking for NUnit test categories . You can attribute you test with the correct category and then run just tests belonging to that category. This gives you much more flexibility than having to define them physically as files or assemblies.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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