1
我可以设置由Rhino.Mocks创建的存根的setter-less属性的返回值吗?如何在存根上设置一个没有setter的属性值?
例如:
public interface IMyMachine { string myProperty { get; } }
...
IMyMachine m = MockRepository.GenerateMock<IMyMachine>();
// implement in a way so that m.myProperty will return "Ahoj!"
if (m.myProperty == "Ahoj!")
//do something
它是不同的不止这一个:http://stackoverflow.com/questions/78389/rhinomocks -correct路到模拟属性的getter – pencilCake