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 tried to mock this object:
var myMock= new Mock<myClass>(); myMock.SetupGet(m => m.ID).Return(555);
He returned me an error:
System.ArgumentException: Invalid setting on non-overlapping element m => m.ID.
Any idea?
Gini
source share