Sometimes you need to write a subclass (often as an inner class) in order to test protected methods.
有时需要编写一个子类(通常作为内部类)来测试protected 的方法。
This approach makes testing protected methods much easier because the test case class can now extend the class that contains the protected methods.
这种方法使得测试受保护的方法非常容易,因为测试案例类现在可以扩展包含受保护方法的类了。
The actual class that represents an .aspx page in action is an instance of a class that derives from Page; hence, it can call into protected methods.
真正代表一个 .aspx活动页面的类是从Page派生的一个类的实例;因此,它能够调入受保护的方法。
By definition, you cannot inherit from a sealed type, which means that protected methods on sealed types cannot be called.
按照定义,不能从密封类型继承,意味着不能调用密封类型上受保护的方法。
To provide a consistent developer experience, these guidelines are required for publicly exposed elements such as public classes and protected methods.
为了提供一致的开发人员体验,公共公开的元素(如公共类和受保护的方法)必须遵守这些准则。
To provide a consistent developer experience, these guidelines are required for publicly exposed elements such as public classes and protected methods.
为了提供一致的开发人员体验,公共公开的元素(如公共类和受保护的方法)必须遵守这些准则。
应用推荐