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

前端 未结 3 1217
遥遥无期
遥遥无期 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:07

    To make it bit DRYer and CTRL+C friendly, here is Spiros Dellaportases (thanks!) answer wrapped in fixture Customization:

    public class OmitExtensionDataObjectPropertyCustomization : ICustomization
    {
        public void Customize(IFixture fixture)
        {
            fixture.Register(() => null);
        }
    }
    

提交回复
热议问题