BenchmarkDotNet icon indicating copy to clipboard operation
BenchmarkDotNet copied to clipboard

Mistake in Overview.md, missing example of multiple tests each in its own file

Open PeterHuberSg opened this issue 6 years ago • 1 comments

https://github.com/dotnet/BenchmarkDotNet/blob/master/docs/articles/overview.md:

The article writes: "The BenchmarkRunner.Run<Md5VsSha256>() call runs your benchmarks … "

However, I cannot find "BenchmarkRunner.Run<Md5VsSha256>()", only "BenchmarkRunner.Run(typeof(Program).Assembly)".

But my real problem is this: In the first example you have a Program class with Main() and a Md5VsSha256 class in the same (!) file. What I cannot figure out is how I can have different test classes in different files. I tried to move Md5VsSha256 in its own file in the same project, but BenchmarkRunner did not find it. I miss in your introduction an explanation how one can have different tests in different files.

PeterHuberSg avatar Nov 08 '19 08:11 PeterHuberSg

Funny enough, after spending a day trying without success and then posting here, suddenly it works to have a test in another file. It would have helped, if Overview would state that the tests can be in any file.

For an experienced user, it seems normal that the test can be in any file. For a new user, it looks like magic and it is very different from how the developer usually tells Visual Studio which code to run. It would help if that magic behavior is described in Overview.

PeterHuberSg avatar Nov 08 '19 10:11 PeterHuberSg