Ms defines get as follows: an accessor method in a property or indexer
that retrieves the value of the property or the indexer element.
So is the following TestDirectory get bad practice?
class Framework
{
string directory;
static string testFolder = "Test";
public static string TestFolder { get { return testFolder; }}
public static string TestDirectory{ get { return directory
+@"\"+testFolde r; }}
public Framework(strin g directory)
{
this.directory = directory;
}
}
should I do this instead:
public static string GetTestDirector y()
{
return directory+@"\"+ testFolder;
}
Thanks,
Aine
that retrieves the value of the property or the indexer element.
So is the following TestDirectory get bad practice?
class Framework
{
string directory;
static string testFolder = "Test";
public static string TestFolder { get { return testFolder; }}
public static string TestDirectory{ get { return directory
+@"\"+testFolde r; }}
public Framework(strin g directory)
{
this.directory = directory;
}
}
should I do this instead:
public static string GetTestDirector y()
{
return directory+@"\"+ testFolder;
}
Thanks,
Aine
Comment