按照定义,不能从密封类型继承,意味着不能调用密封类型上受保护的方法。
By definition, you cannot inherit from a sealed type, which means that protected methods on sealed types cannot be called.
这种方法使得测试受保护的方法非常容易,因为测试案例类现在可以扩展包含受保护方法的类了。
This approach makes testing protected methods much easier because the test case class can now extend the class that contains the protected methods.
为了提供一致的开发人员体验,公共公开的元素(如公共类和受保护的方法)必须遵守这些准则。
To provide a consistent developer experience, these guidelines are required for publicly exposed elements such as public classes and protected methods.
应用推荐