如果您有房产:
public class Fred { public string UserName { set { userName=value; } } }
你如何使用Rhino Mocks来检查它
fred= new Fred(); fred.UserName="Jim";
叫做.
Expect.Call(mockFred.UserName).SetPropertyWithArgument("Jim");
不编译.
public interface IFred { string UserName { set; } } [Test] public void TestMethod1() { IFred fred = MockRepository.GenerateMock(); fred.UserName = "Jim"; fred.AssertWasCalled(x => x.UserName = "Jim"); }