You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: