Private/Public variables
Posted: Tue Sep 12, 2017 6:13 pm
Hi,
Should I use public or private variables in the code module?
string _appStat = "Running";
[TestVariable("58fcdded-b7c1-4f10-88a3-84d53b17daed")]
public string appStat
{
get { return _appStat; }
set { _appStat = value; }
}
public CheckStat()
{
// Do not delete - a parameterless constructor is required!
}
void ITestModule.Run()
{
Mouse.DefaultMoveTime = 300;
Keyboard.DefaultKeyPressTime = 100;
Delay.SpeedFactor = 1.0;
if (appStat.Equals("Failed"))
{
// Close app
}
}
Or if (_appestat.Equals("Failed"))
Any differences if used (_appestat) or (appStat) in this case? Which one do you recommend?
Thanks
Should I use public or private variables in the code module?
string _appStat = "Running";
[TestVariable("58fcdded-b7c1-4f10-88a3-84d53b17daed")]
public string appStat
{
get { return _appStat; }
set { _appStat = value; }
}
public CheckStat()
{
// Do not delete - a parameterless constructor is required!
}
void ITestModule.Run()
{
Mouse.DefaultMoveTime = 300;
Keyboard.DefaultKeyPressTime = 100;
Delay.SpeedFactor = 1.0;
if (appStat.Equals("Failed"))
{
// Close app
}
}
Or if (_appestat.Equals("Failed"))
Any differences if used (_appestat) or (appStat) in this case? Which one do you recommend?
Thanks