Ejemplo n.º 1
0
        public void AddCorrectSwitchesToEmptyCollection(
            CommandLineSwitch firstSwitch, CommandLineSwitch secondSwitch)
        {
            var switches = new CommandLineSwitchSet();

            switches.AddSwitch(firstSwitch);
            switches.AddSwitch(secondSwitch);
        }
Ejemplo n.º 2
0
            // 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);
            }
Ejemplo n.º 3
0
        public void AddConflictingSwitchesToEmptyCollection(
            CommandLineSwitch firstSwitch, CommandLineSwitch secondSwitch)
        {
            var switches = new CommandLineSwitchSet();

            switches.AddSwitch(firstSwitch);

            Assert.Throws <InvalidOperationException>(() =>
            {
                switches.AddSwitch(secondSwitch);
            });
        }
Ejemplo n.º 4
0
        public void AddCorrectSwitchesToCollection(CommandLineSwitch[] switches)
        {
            var switchArray = new CommandLineSwitch[] { switches[0], switches[1] };

            var switchesCollection = new CommandLineSwitchSet(switchArray);

            switchesCollection.AddSwitch(switches[2]);
        }
Ejemplo n.º 5
0
        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]);
        }