how to use xUnit and FsCheck with IoC and mocking in F#

∥☆過路亽.° 提交于 2019-12-04 06:40:46

问题


I want to write unit tests F# using property base testing technic. however I came across several obstacle.

  1. Code I want to test is in C#
  2. Domain objects come from EF i.e. no constructors only mutable properties
  3. sut is a class that will require a lot of constructor injections. Their number will change quite frequently as we add new functions. We do not want to change old tests when we add new parameter to constructor.
  4. sut already exists and is working so changing it pattern to take only one factory parameter in constructor would be considered test induced damage so it's a no go
  5. FsCheck is unable to generate out of box entity framework objects so we are forced to write large generators for each entity - is there any library that will do it for us or make this task a lot easier?

In other words is it possible to combine FsCheck with Ninject (we use it in application so adding new one is also no go) with some auto entity generator and mocking tool?

来源:https://stackoverflow.com/questions/35738775/how-to-use-xunit-and-fscheck-with-ioc-and-mocking-in-f

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!