Nsubstitute Mocking readonly property

20 Views Asked by At
1

There are 1 best solutions below

0
LuftWaffle On

You could use Nsubstitute Returns method :

var myObjectMock = Substitute.For<MyClass>();
myObjectMock.DefaultHostName.Returns("DefaulHostName");