Eg: I have an interface with a property and a method. The method does something with the value of the property. How do I setup the mock to access the value of property?
interface myInterface
{
Id{get;set;}
string ReturnIdAsString();
}
Mock<myInterface> mock = new Mock<myInterface>();
mock.Setup(m => m.Id).Returns(1);
mock.Setup(m => m.ReturnsIdAsString).Returns(**would like to return m.Id here**);
mock.Object.ReturnsIdAsString(); //should return the value in m.Id
How do I setup ReturnsIdAsString to access the property Id?