The following constructor parameters did not have matching fixture data

前端 未结 3 1888
感动是毒
感动是毒 2021-02-12 16:29

I\'m trying to test my controllers using xUnitbut getting the following error during execution of Customer Controller:

\"The following constr

3条回答
  •  梦谈多话
    2021-02-12 16:59

    For the testing framework, you need the mocking library to inject a mock object through DI in your testing classes. You can use Nmock, Moq or any other mocking library to setup the constructor injection.

    https://www.c-sharpcorner.com/uploadfile/john_charles/mocking-in-net-with-moq/

    http://nmock.sourceforge.net/quickstart.html

提交回复
热议问题