📜  nsubstitute 配置属性 - 任何代码示例

📅  最后修改于: 2022-03-11 15:00:05.209000             🧑  作者: Mango

代码示例1
The return value for a property can be set in the same way as for a method, using Returns(). You can also just use plain old property setters for read/write properties; they’ll behave just the way you expect them to.
calculator.Mode.Returns("DEC");
Assert.AreEqual(calculator.Mode, "DEC");

calculator.Mode = "HEX";
Assert.AreEqual(calculator.Mode, "HEX");