I constructed the following class:
public class FSCServerLocator
{
public string userLocation { get; private set; }
public string FSCServer
{
get
{
switch (userLocation)
{
default:
return @"\\himgwsfs01\QT_Tools\Diagnose\09_SWT_FSCs";
}
}
}
public FSCServerLocator(string location)
{
if (string.IsNullOrWhiteSpace(userLocation))
{
throw new Exception("No location included at initialization");
}
//parameter filtering
userLocation = location;
}
}
}
And calling the object like this
var fscServerLocator = new FSCServerLocator(@"\\himgwsfs01\QT_Tools\Diagnose\09_SWT_FSCs");
When running the program an unhandled exception is thrown saying {"No location included at initialization"}
.
I only want to see if the location is reached but maybe I am missing something since i am new in c#