问题
I want to write unit tests F# using property base testing technic. however I came across several obstacle.
- Code I want to test is in C#
- Domain objects come from EF i.e. no constructors only mutable properties
- 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.
- 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
- 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