コード例 #1
0
        static void Main()
        {
            var fs = new FileSystemHelper();
            var commandLineProgram = new CommandLineProgram();
            var processRunner = new ProcessRunner(commandLineProgram);
            var outputWriter = new OutputWriter();
            var nodeModulesHelper = new NodeModulesHelper(processRunner, fs);
            var systemDependencyChecker = new SystemDependencyChecker(outputWriter);

            var systemDependencies = new ISystemDependency[]
                {
                    new NodeJsSystemDependency(processRunner),
                    new KarmaSystemDependency(processRunner, nodeModulesHelper),
                    new KarmaSpecReporterSystemDependency(nodeModulesHelper, fs),
                    new KarmaJunitReporterSystemDependency(nodeModulesHelper, fs),
                    /*Example of checking express*/
                    /*new NodeModuleSystemDependency("express", nodeModulesHelper, fs)*/
                };

            foreach (ISystemDependency systemDependency in systemDependencies)
            {
                systemDependencyChecker.CheckSystemDependency(systemDependency);

                if (systemDependency is ISystemDependencyWithVersion)
                {
                    systemDependencyChecker.CheckSystemDependencyVersion(systemDependency as ISystemDependencyWithVersion);
                }
            }

            Console.WriteLine("Press any key to continue...");
            Console.Read();
        }
コード例 #2
0
 public NodeModulesHelper(ProcessRunner processRunner, FileSystemHelper fileSystemHelper)
 {
     _processRunner = processRunner;
     _fileSystemHelper = fileSystemHelper;
 }