3
私のテストではたくさんのリフレクションを使用しています。 NSubstituteは、このように反射の特性(PropertyInfo
)を模擬することができますNS substituteはMethodInfoの戻り値をモックできますか?
mock
.GetType().GetTypeInfo()
.GetProperty("SomePropertyName")
.GetValue(mock)
.Returns(someReturnValue); // NSubstitute does its thing here
私はMethodInfo
のために似たような方法をお教えください。