MSTest Equivalent for NUnit's Parameterized Tests?

前端 未结 6 1597
栀梦
栀梦 2020-12-01 17:31

NUnit supports a feature where you can specify a set of data inputs for a unit test to be run multiple times.

[RowTest]
[Row(1001,1,2,3)]
[Row(1,1001,2,3)]
[         


        
6条回答
  •  生来不讨喜
    2020-12-01 18:08

    Actually, the Parameterized Unit Test (PUT) is a natural generalization of unit test. And Microsoft Research has a project called Pex that will generate the PUT for your Class Under Test (CUT) automatically. Pex is an auto test input generation tool. Instead of preparing the test data yourself, the Pex tool will find the inputs of interest for the parameters of CUT and generate the unit test cases accordingly. Please check here.

提交回复
热议问题