StackOverflow 文档 moq 教程 模仿行为 无论证方法模仿 无论证方法模仿 Created: November-22, 2018 interface Mockable { bool DoSomething(); } var mock = new Mock<Mockable>(); mock.Setup(x => x.DoSomething()).Returns(true); var result = mock.Object.DoSomething(); //true 嘲笑受保护的成员模仿行为