Auto-generation of .NET unit tests

后端 未结 12 1759
故里飘歌
故里飘歌 2020-12-14 14:59

Is there such a thing as unit test generation? If so...

...does it work well?

...What are the auto generation solutions that are available for .NET?

12条回答
  •  轮回少年
    2020-12-14 15:39

    GennyMcGenFace creates a unit test for each function in your class and generates objects with random words/values in each parameter.

    • Generate unit tests for each function in your class
    • Figures out valid randomly generated values for the paramater inputs and the returns statement.
    • Mockable interfaces return valid randomly generated values
    • Generate unit tests for each function in your class
    • Imports all the needed namespaces into your test class

    It helps in setting up your unit tests, especially if you have input objects with lots of parameters.

    The unit test will look something like this

提交回复
热议问题