None of the Mock.Expect
examples I've found use Times
other than 0 or 1 (never, once).
I modifed one of the existing tests from Foq.Usage.fsx to attempt something that's not 0 or 1, but I can't make it work.
Does anyone see anything wrong?
let [<Test>] ``expect method is called the specified number of times`` () =
// Arrange
let xs = Mock.Of<System.Collections.Generic.IList<int>>()
// Assert (setup)
Mock.Expect(<@ xs.Contains(0) @>, never)
Mock.Expect(<@ xs.Contains(1) @>, once)
Mock.Expect(<@ xs.Contains(2) @>, exactly 2)
// Act
xs.Contains(1) |> ignore
xs.Contains(2) |> ignore
xs.Contains(2) |> ignore
// Assert
verifyAll xs