public void RunAtIsolatedProcess_should_run_specified_action_in_different_process() { // Arrange var bag = new MarshalByRefBag(); bag["Expected"] = Process.GetCurrentProcess().Id; bag["Actual"] = bag["Expected"]; // Act AppDomain.CurrentDomain.RunAtIsolatedProcess(bag_ => { bag_["Actual"] = Process.GetCurrentProcess().Id; }, bag); // Assert Assert.AreNotEqual(bag["Expected"], bag["Actual"]); }
public void RunAtIsolatedDomain_should_run_specified_action_in_different_app() { // Arrange var bag = new MarshalByRefBag(); bag["Expected"] = AppDomain.CurrentDomain.GetHashCode(); bag["Actual"] = bag["Expected"]; // Act AppDomain.CurrentDomain.RunAtIsolatedDomain(bag_ => { bag_["Actual"] = AppDomain.CurrentDomain.GetHashCode(); }, bag); // Assert Assert.AreNotEqual(bag["Expected"], bag["Actual"]); }