Ploeh AutoFixture was unable to create an instance from System.Runtime.Serialization.ExtensionDataObject

前端 未结 3 1181
遥遥无期
遥遥无期 2021-01-17 07:44

We have an MVC project with references to WCF services. Those references added (ExtensionDataObject)ExtensionData property to every DTO and Response object and

3条回答
  •  醉话见心
    2021-01-17 08:01

    The easiest way to do it is:

    fixture.Register(() => null);
    

    That registers to AutoFixture a specific way to initialize all the ExtensionDataObject, with the Func given. In this case the Func always returns null so you are good to go.

提交回复
热议问题