我认为这与在
Verify()
上使用times
参数有关。open NUnit.Framework
open Moq
type IService = abstract member DoStuff : unit -> unit
[<Test>]
let ``Why does this throw an exception?``() =
let mockService = Mock<IService>()
mockService.Verify(fun s -> s.DoStuff(), Times.Never())
异常信息:
System.ArgumentException:无法将类型为“System.Void”的表达式用作类型为“Microsoft.FSharp.Core.Unit”的构造函数参数