Skip to main content
 首页 » 编程设计

c#之这个方法在 CUIT 上的目的是什么

2024年02月13日10Leo_wl

有谁知道编码 UI 测试中此代码片段的注释类的目的是什么?

namespace CUITe_Training 
{ 
 
[CodedUITest] 
public class CodedUITest1 
{ 
    public CodedUITest1() // < --- what is the purpose of this? 
    { 
    } 
 
    [TestMethod] 
    public void CodedUITestMethod1() 
    { 
 
    } 
} 
} 

谢谢!

请您参考如下方法:

这是您的类的构造函数,用于对象实例化。

参见:Constructors C#

还有:Using Constructors (C# Programming Guide)

When a class or struct is created, its constructor is called. Constructors have the same name as the class or struct, and they usually initialize the data members of the new object.