Any idea in Moq for a class with readonly modifier :
Class myClass
{
private int id;
public int Id{ get {return id;}}
public myClass(int id)
{ this.id = id }
}
I was trying to mock this object:
var myMock= new Mock<myClass>();
myMock.SetupGet(m => m.ID).Return(555);
It returned me error:
System.ArgumentException: Invalid setup on a non-overridable member m=>m.ID.
Any idea?