public void AddCorrectSwitchesToEmptyCollection( CommandLineSwitch firstSwitch, CommandLineSwitch secondSwitch) { var switches = new CommandLineSwitchSet(); switches.AddSwitch(firstSwitch); switches.AddSwitch(secondSwitch); }
// It's not required to setup switches in static constructor. // You can do it in another place. static Switches() { // Create a new set of switches and fill it with default switches. Set = new CommandLineSwitchSet(DefaultSwitches.Collection); // Add custom switches to set. Set.AddSwitch(UserName); Set.AddSwitch(Greeting); }
public void AddConflictingSwitchesToEmptyCollection( CommandLineSwitch firstSwitch, CommandLineSwitch secondSwitch) { var switches = new CommandLineSwitchSet(); switches.AddSwitch(firstSwitch); Assert.Throws <InvalidOperationException>(() => { switches.AddSwitch(secondSwitch); }); }
public void AddCorrectSwitchesToCollection(CommandLineSwitch[] switches) { var switchArray = new CommandLineSwitch[] { switches[0], switches[1] }; var switchesCollection = new CommandLineSwitchSet(switchArray); switchesCollection.AddSwitch(switches[2]); }
public void AddCorrectSwitchesToCopiedCollection(CommandLineSwitch[] switches) { var switchArray = new CommandLineSwitch[] { switches[0], switches[1] }; var sourceSwitches = new CommandLineSwitchSet(switchArray); var copySwitches = new CommandLineSwitchSet(sourceSwitches); copySwitches.AddSwitch(switches[2]); }