Using Visual studio, I'm writing a unit test for a program already written using .Net framework 2.0. All the usual unit tests are working fine except testing of Main (the entry point to the application). The program's Main method is declared without any String[] being passed as argument. The program processes command line arguments using Environment.getCommandLineArgs() in an associated object. The main program looks like following:
[STAThread]
static void Main()
{
MainProcessor StartProgram = new MainProcessor();
StartProgram.main();
StartProgram = null;
}
and command line arguments are processed in main like:
public void main() {
String [] args = Environment.getCommandLineArgs();
// process arguments
}
Is there any way to manipulate command line arguments from a test method and processing them using Environment.getCommandLineArgs() as mentioned above?