public static IBuildStrategy GetBuildStrategy(this BuildStrategyType type, ProjectRunnerArguments args) { switch (type) { case BuildStrategyType.MSBuild14: return(new MSBuild14BuildStrategy()); case BuildStrategyType.MSBuild12: return(new MSBuild12BuildStrategy()); case BuildStrategyType.VisualStudio: return(new VisualStudioBuildStrategy()); case BuildStrategyType.Microsoft: return(new MicrosoftBuildStrategy()); case BuildStrategyType.Script: return(new ScriptBuildStrategy(args.BuildScriptPath)); case BuildStrategyType.None: return(new NoneBuildStrategy()); default: throw new ArgumentOutOfRangeException(); } }
public static void Main(string[] args) { foreach (var arg in args) { if (arg.Equals("--help")) { Console.Write(CommandLineUtil.HelpText(cmdLineExample, typeof(LocalProjectRunnerArguments))); return; } } var cmdOptions = CommandLineUtil.ParseArguments <CommandLineOptions>(args); if (cmdOptions != null) { if (cmdOptions.ConfigurationFilePath != null) { TestCommons.RunWithConfiguration(File.ReadAllText(cmdOptions.ConfigurationFilePath)); } else { string[] unknownArgs = new string[0]; Type runnerArgumentsType = cmdOptions.TestSource.GetArgumentsType(); int firstUnknownArg = CommandLineUtil.FindFirstUknownArg(args, runnerArgumentsType); if (firstUnknownArg >= 0) { unknownArgs = args.Skip(firstUnknownArg).ToArray(); } ProjectRunnerArguments runnerArgs = CommandLineUtil.ParseArguments(args, runnerArgumentsType) as ProjectRunnerArguments; runnerArgs.TestingFrameworkArguments = unknownArgs; TestCommons.RunWithArgs(runnerArgs); } } }
public RepositoryProjectRunner(ProjectRunnerArguments args) : base(args) { if (!(args is RepositoryProjectRunnerArguments)) { throw new ArgumentException("Incorrect type of arguments provided!"); } this.args = args as RepositoryProjectRunnerArguments; }
public static ProjectRunner GetProjectRunner(this ProjectRunnerType type, ProjectRunnerArguments args) { switch (type) { case ProjectRunnerType.TestProject: return(new TestProjectRunner(args)); case ProjectRunnerType.LocalRepository: return(new LocalRepositoryProjectRunner(args)); case ProjectRunnerType.RemoteRepository: return(new RemoteRepositoryProjectRunner(args)); case ProjectRunnerType.LocalProject: return(new LocalProjectRunner(args)); default: throw new System.Exception($"ProjectRunnerType: {type} Not Supported"); } }
public ProjectRunner(ProjectRunnerArguments args) { this.args = args; }