-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
Hi.
I'd like to try unit-testing with mocks in F# as well as other .NET languages,
and your library looks powerful and so cool.
But I came across a problem on an elementary program as following.
When I try to create 2 mock instances of the same type,
it throws System.ArgumentException with a message
such as "An item is already added that contains same key".
I'm sorry but the message is not accurate because it was translated to my mother language...
What shall I do to make multiple mockery-instanciation work?
Karak
-- code for reproduction
#light
module MultipleInstanciation
open NaturalSpec
type IFoo = interface
end
let binaryFunc (foo1: IFoo) (foo2: IFoo) : unit = ()
type FooImpl = class
new() = {}
interface IFoo
end
[<Scenario>]
let ``try to create 2 mock-instance``() =
let foo1 = mock<IFoo> "mock1"
let foo2 = mock<IFoo> "mock2" // throw Exception!
//let foo2 = new FooImpl ()
Given foo2
|> When calculating binaryFunc foo1
|> Verify
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels