static int Main(string[] argumentsArray)
 {
     var args = GetArguments(argumentsArray);
     if (args == null || args.RunType == RunType.Help)
     {
         Arguments.WriteHelp();
         return ExitCode.ErrorOnArgument;
     }
     var environment = new LocalEnvironment();
     IPhantomJS phantomJS;
     try
     {
         phantomJS = new PhantomJSFactory(args, environment).Create();
     }
     catch (JasmineConfigurationFileDoesNotExistException)
     {
         WriteError("Jasmine configuration file for default run could not be found at '{0}'.", environment.GetJasmineConfigurationFileLocation());
         Arguments.WriteHelp();
         return ExitCode.JasmineConfigurationFileForDefaultRunCouldNotBeFound;
     }
     var program = new JasmineRunner(new Tools(environment), phantomJS);
     var runSucceeded = program.Run();
     phantomJS.Dispose();
     return runSucceeded ? ExitCode.TestsPassed : ExitCode.TestsFailed;
 }
Esempio n. 2
0
        static int Main(string[] argumentsArray)
        {
            var args = GetArguments(argumentsArray);

            if (args == null || args.RunType == RunType.Help)
            {
                Arguments.WriteHelp();
                return(ExitCode.ErrorOnArgument);
            }
            var        environment = new LocalEnvironment();
            IPhantomJS phantomJS;

            try
            {
                phantomJS = new PhantomJSFactory(args, environment).Create();
            }
            catch (JasmineConfigurationFileDoesNotExistException)
            {
                WriteError("Jasmine configuration file for default run could not be found at '{0}'.", environment.GetJasmineConfigurationFileLocation());
                Arguments.WriteHelp();
                return(ExitCode.JasmineConfigurationFileForDefaultRunCouldNotBeFound);
            }
            var program      = new JasmineRunner(new Tools(environment), phantomJS);
            var runSucceeded = program.Run();

            phantomJS.Dispose();
            return(runSucceeded ? ExitCode.TestsPassed : ExitCode.TestsFailed);
        }