I am trying to get access to a mocked (via Nsubstitute) class that was injected onto the constructor.
I was using the following code
var fixture = new Fixture()
.Customize(new AutoNSubstituteCustomization());
var sut = fixture.Create<MyService>();
The sut is created sucessfully, and a mocked version of an interface called "IFileUtils" is injected on the constructor of "MyService".
but i need access to it, so after reading I believe I need to freeze the object so I have access to it like so
var fileUtilMock= fixture.Freeze<Mock<IFileUtils>>();
But this code I believe is a Moq syntax as "Mock" can't be found.
Normally to create a Nsubstitute of a class you do the following
var fileUtilMock= Substitute.For<IFileUtils>();
but of course this isn't frozen so its not used and injected into the constructor.
can anyone help?