コード例 #1
0
        public void MultipleBooleanFlags()
        {
            BooleanFlag flag = new BooleanFlag();

            Assert.IsFalse(flag.Apple);
            Assert.IsFalse(flag.Baby);
            Assert.IsFalse(flag.LikeCardinals);
            ConsoleArgs <BooleanFlag> .Populate("ConsoleArgs.dll -a --b -c", flag);

            // Validate the populated settings.
            Assert.IsTrue(flag.Apple);
            Assert.IsTrue(flag.Baby);
            Assert.IsTrue(flag.LikeCardinals);
        }
コード例 #2
0
        public void DoubleDashBooleanWord()
        {
            BooleanFlag flag = new BooleanFlag();

            Assert.IsFalse(flag.Apple);
            Assert.IsFalse(flag.Baby);
            Assert.IsFalse(flag.LikeCardinals);
            ConsoleArgs <BooleanFlag> .Populate("ConsoleArgs.dll --apple", flag);

            // Validate the populated settings.
            Assert.IsTrue(flag.Apple);
            Assert.IsFalse(flag.Baby);
            Assert.IsFalse(flag.LikeCardinals);
        }