public void Copy() { HostSetup setup = new HostSetup { ApplicationBaseDirectory = @"C:\AppBase", Configuration = { ConfigurationXml = "<xml/>" }, ConfigurationFileLocation = ConfigurationFileLocation.AppBase, ProcessorArchitecture = ProcessorArchitecture.Amd64, ShadowCopy = true, DebuggerSetup = new DebuggerSetup(), RuntimeVersion = "2.0.50727", Elevated = true, WorkingDirectory = @"C:\WorkingDir", }; setup.AddHintDirectory("Abc"); setup.AddProperty("abc", "def"); HostSetup copy = setup.Copy(); Assert.AreEqual(setup.ApplicationBaseDirectory, copy.ApplicationBaseDirectory); Assert.AreEqual(setup.Configuration.ConfigurationXml, copy.Configuration.ConfigurationXml); Assert.AreEqual(setup.ConfigurationFileLocation, copy.ConfigurationFileLocation); Assert.AreEqual(setup.ProcessorArchitecture, copy.ProcessorArchitecture); Assert.AreEqual(setup.ShadowCopy, copy.ShadowCopy); Assert.AreEqual(setup.Elevated, copy.Elevated); Assert.IsNotNull(copy.DebuggerSetup); Assert.AreEqual(setup.RuntimeVersion, copy.RuntimeVersion); Assert.AreEqual(setup.WorkingDirectory, copy.WorkingDirectory); Assert.AreEqual(setup.HintDirectories, copy.HintDirectories); Assert.AreEqual(setup.Properties, copy.Properties); }
/// <summary> /// Sets the part cover coverage file. /// </summary> /// <param name="hostSetup">The host setup.</param> /// <param name="partCoverCoverageFile">The part cover coverage file.</param> internal static void SetPartCoverCoverageFile(HostSetup hostSetup, string partCoverCoverageFile) { if (hostSetup == null) { throw new ArgumentNullException("hostSetup"); } hostSetup.RemoveProperty("PartCoverCoverageFile"); hostSetup.AddProperty("PartCoverCoverageFile", partCoverCoverageFile); }
/// <inheritdoc /> sealed protected override object RunIsolatedTaskImpl <TIsolatedTask>(HostSetup hostSetup, StatusReporter statusReporter, object[] args) { hostSetup = hostSetup.Copy(); foreach (var pair in TestIsolationOptions.Properties) { if (!hostSetup.Properties.ContainsKey(pair.Key)) { hostSetup.AddProperty(pair.Key, pair.Value); } } return(RunIsolatedTaskInHost <TIsolatedTask>(hostSetup, statusReporter, args)); }
/// <summary> /// Creates a host setup based on the package properties. /// </summary> /// <returns>The host setup.</returns> public HostSetup CreateHostSetup() { var hostSetup = new HostSetup { DebuggerSetup = DebuggerSetup, ShadowCopy = ShadowCopy, ApplicationBaseDirectory = ApplicationBaseDirectory != null ? ApplicationBaseDirectory.FullName : null, WorkingDirectory = WorkingDirectory != null ? WorkingDirectory.FullName : null, RuntimeVersion = RuntimeVersion }; GenericCollectionUtils.ForEach(Properties, x => hostSetup.AddProperty(x.Key, x.Value)); GenericCollectionUtils.ForEach(HintDirectories, x => hostSetup.AddHintDirectory(x.FullName)); return(hostSetup); }
internal static void SetNCoverCoverageFile(HostSetup hostSetup, string ncoverCoverageFile) { hostSetup.RemoveProperty("NCoverCoverageFile"); hostSetup.AddProperty("NCoverCoverageFile", ncoverCoverageFile); }