Пример #1
0
        public void Exists_ShouldBeFalse_WhenEmptyArgs()
        {
            var option = new CommandLineOption("zero", new string[0]);

            var result = option.Exists();

            result.Should().BeFalse();
        }
Пример #2
0
        public void Exists_ShouldBeTrue_WhenOptionInArgs_PrecededWithDoubleMinus()
        {
            var args   = new[] { "one", "-two", "--three", "--zero" };
            var option = new CommandLineOption("zero", args);

            var result = option.Exists();

            result.Should().BeTrue();
        }
Пример #3
0
        public void Exists_ShouldBeFalse_WhenNoOptionInArgs()
        {
            var args   = new [] { "zero", "one", "-two", "--three", "--h", "z", "-z", "--z", "0", "\"day.com\"" };
            var option = new CommandLineOption("zero", args);

            var result = option.Exists();

            result.Should().BeFalse();
        }
Пример #4
0
        private static void HandleIntentionalCrash(Application app, string[] args)
        {
            var option = new CommandLineOption("crash", args);

            if (!option.Exists())
            {
                return;
            }

            app.Deactivated += (sender, ea) => throw new StackOverflowException("Intentional crash test");
        }