Answers for "nsubstitute configure property"

1

nsubstitute configure property

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");
Posted by: Guest on April-08-2021

Browse Popular Code Answers by Language