示例#1
0
        public void ArgumentDefaultsMatchContextDefaults()
        {
            var argumentDefaults = UnderTest.CommandLineContext.Arguments.Defaults;
              var context          = new UnderTest.CommandLineContext(new string[0]);
              var argsType         = context.Args.GetType();

              foreach (var key in argumentDefaults.Keys)
              {
            var prop = argsType.GetProperty(key);

            prop.Should().NotBeNull("because the arguments type should have a property named {0}", key);
            prop.GetValue(context.Args).Should().Be(argumentDefaults[key], "because the  argument value should match the defaults for {0}", key);
              }
        }
示例#2
0
        public void ArgumentDefaultsMatchContextDefaults()
        {
            var argumentDefaults = UnderTest.CommandLineContext.Arguments.Defaults;
            var context          = new UnderTest.CommandLineContext(new string[0]);
            var argsType         = context.Args.GetType();

            foreach (var key in argumentDefaults.Keys)
            {
                var prop = argsType.GetProperty(key);

                prop.Should().NotBeNull("because the arguments type should have a property named {0}", key);
                prop.GetValue(context.Args).Should().Be(argumentDefaults[key], "because the  argument value should match the defaults for {0}", key);
            }
        }
示例#3
0
        /// <summary>
        ///   The method called as the main entry point for the application.
        /// </summary>
        ///
        /// <param name="args">The arguments passed to the application on the command line.</param>
        ///
        public static void Main(string[] args)
        {
            var context = new CommandLineContext(args ?? new string[0]);

            // If the command line arguments were not passed correctly or the help switch
            // was set, then display the help text to the console.

            if ((context.HasArgumentErrors) || (context.Args.Help))
            {
                EntryPoint.DisplayHelp <CommandLineContext.Arguments>(CommandLineContext.Arguments.Defaults);
                return;
            }

            // Force all paths to be fully qualified when forming the PhantomJS arguments and launching the
            var phantomArguments = ProcessManager.FormatPhantomArguments(Path.GetFullPath(context.Args.TestScriptPath), Path.GetFullPath(context.Args.TestSuitePath));

            ProcessManager.Launch(Path.GetFullPath(context.Args.PhantomPath), phantomArguments, Path.GetTempPath(), EntryPoint.SegmentProcessor);
        }