public void Execute_Simulated() { SimulatedCapturedProcess simulated = new SimulatedCapturedProcess(0, null, (string) null); ICapturedProcessFactory factory = new SimulatedCapturedProcessFactory(simulated); Parent.AssemblyToJarTask victim = new Parent.AssemblyToJarTask(false, factory); victim.AssemblyPaths = "Dependencies/Organization.Product.dll"; victim.ExecuteForTest(); Assert.IsTrue(simulated.PathToExecutable.EndsWith("Converter.exe")); Regex re = new Regex(@"^ (""?.+Dependencies[/\\]Organization\.Product.dll""?)\s (""?/lib:.+[/\\]v2\.0\.50727;.+Dependencies""?)\s (""?/out:.+Dependencies[/\\]Organization\.Product.jar""?) $", RegexOptions.IgnorePatternWhitespace); Assert.IsTrue(re.IsMatch(simulated.ArgumentString)); }
/// <summary> /// Initializes an instance of the <see cref="SimulatedCapturedProcessFactory"/> with the specified /// <paramref name="instance"/>. /// </summary> /// /// <param name="instance"> /// A single instance of <see cref="SimulatedCapturedProcess"/> that will be configured on each call to /// <see cref="ICapturedProcessFactory.Create(string, IEnumerable{object}, Action{string}, Action{string})"/>. /// </param> public SimulatedCapturedProcessFactory(SimulatedCapturedProcess instance) { _instance = instance; }
/// <summary> /// Initializes an instance of the <see cref="SimulatedCapturedProcessFactory"/> with the specified /// <paramref name="instance"/>. /// </summary> /// /// <param name="instance"> /// A single instance of <see cref="SimulatedCapturedProcess"/> that will be configured on each call to /// <see cref="ICapturedProcessFactory.Create(string, IEnumerable{object}, Action{string}, Action{string})"/>. /// </param> public SimulatedCapturedProcessFactory(SimulatedCapturedProcess instance) { _instance = instance; }