Does anyone know what is the purpose of the commented class on this code snip in Coded UI tests?

namespace CUITe_Training
{

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

    [TestMethod]
    public void CodedUITestMethod1()
    {

    }
}
}

Thank you!

有帮助吗?

解决方案

That is the constructor for your class and used for object instantiation.

See: Constructors C#

Also: 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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top