Closed jeusdi closed 7 years ago
You didn't read the example carefully! Look at this place:
//setup the mock
var barMock = _kernel.GetMock<IBar>();
barMock.Setup(mock => mock.GetContent()).Returns("mocked Content");
and here's your code:
var mock = this.IoCKernel.Bind<Core.Configuration.ICoreConfiguration>().ToMock();
mock.Setup(...);
You don't get the mock, you just declare the binding.
I'm about to suicide!
Currently:
var mock = this.IoCKernel
.Bind<Core.Configuration.ICoreConfiguration>()
.ToMock();
Nevertheless compiler is getting me that Setup
method is not available!!
Please use GetMock to get mock object.
GetMock
is not available!!! Could you provide an example using NSubstituteMockingKernel? Which usings do I need to add?
I've configured a
MockingKernel
in order to mock a dependency:According to this documentation I need to call a
Setup
method in order to substitute methods. Nevertheless,Setup
method is not available.Any ideas?