ReSharper 2020.2 Help

Code Inspection: NUnit. Specified attribute values produce too many tests

Whey you specify values for your tests with Range, Random, or Values attributes or create combinations of values with Combinatorial, Sequential, or Pairwise attributes, you may end up having too many tests. For example:

[Test] public void Test1( // 2^31 tests [Random(int.MaxValue)] int x) { // do something } [Test, Combinatorial] public void Test2( // 1M tests [Random(1000)] int x, [Random(1000)] int y, [Random(1000)] int z) { // do something }

Assuming that this number of tests is not what you expect, ReSharper issues a warning about too many tests. By default, ReSharper limits the maximum number of tests to 1000 and it is not configurable in the default UI. However, if you want to change this limit, you can Run ReSharper in the internal mode and use the Skip parameterized test after input data exceeds [x] items option on the Tools | Unit Testing | General page of ReSharper options (Alt+R O).

Last modified: 08 May 2020