0

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?

Icen
  • 441
  • 6
  • 14
  • 1
    Since this is five questions, I'd recommend closing this particular post, and instead opening five individual posts, so that you can get varying answers to each one. – Mark Seemann Mar 02 '16 at 10:49
  • Thanks Mark I'll do as you advice – Icen Mar 02 '16 at 15:14
  • As suggested this question is split in to two: [here](http://stackoverflow.com/questions/35765611/using-ninject-with-mocks-in-f) is about IoC and mocking. Second question about generating EF objects in FsCheck can be found [here](http://stackoverflow.com/questions/35764092/generating-random-objects-as-test-cases) – Icen Mar 03 '16 at 15:21

0 Answers0