Question

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!

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top