Constructor injection is by far the most common injection type in object-oriented programming. This is, of course, in order to make the necessary dependencies mandatory and not have to check if they're set or not.
Here is what constructor injection would look like in F#:
type CustomerRepository (csvReader : ICsvReader) = member this.Load filePath = csvReader.Load filePath |> Seq.map schema |> Seq.toList
The dependency, which here is the ICsvReader, is received in the constructor of the
The way to test this is pretty obvious; by creating a test double for the ICsvReader, as seen before, and injecting it into the constructor:
[<Test>] let ``should parse ID as int`` () =...