TypeMockProcess Class

Typemock Isolator Developer Guide
This class manages Processes running with Typemock Isolator.
Inheritance Hierarchy

SystemObject
  SystemMarshalByRefObject
    System.ComponentModelComponent
      System.DiagnosticsProcess
        TypeMock.IntegrationTypeMockProcess

Namespace:  TypeMock.Integration
Assembly:  TypeMock.Integration (in TypeMock.Integration.dll) Version: 8.0.0.0 (8.0.0.0)
Syntax

public class TypeMockProcess : Process, 
	IDisposable

The TypeMockProcess type exposes the following members.

Constructors

  NameDescription
Public methodTypeMockProcess(ProcessStartInfo)
Create a new process with Typemock Isolator enabled
Public methodTypeMockProcess(ProcessStartInfo, Boolean)
Create a new process with Typemock Isolator enabled
Public methodTypeMockProcess(ProcessStartInfo, String)
Create a new process with Typemock Isolator enabled and a code coverage tool linked
Top
Properties

  NameDescription
Public propertyBasePriority
Gets the base priority of the associated process.
(Inherited from Process.)
Public propertyBlocking
Protected propertyCanRaiseEvents
Gets a value indicating whether the component can raise an event.
(Inherited from Component.)
Protected propertyEvents
Gets the list of event handlers that are attached to this Component.
(Inherited from Component.)
Public propertyHandleCount
Gets the number of handles opened by the process.
(Inherited from Process.)
Public propertyId
Gets the unique identifier for the associated process.
(Inherited from Process.)
Public propertyMainWindowHandle
Gets the window handle of the main window of the associated process.
(Inherited from Process.)
Public propertyMainWindowTitle
Gets the caption of the main window of the process.
(Inherited from Process.)
Public propertyMaxWorkingSet
Gets or sets the maximum allowable working set size for the associated process.
(Inherited from Process.)
Public propertyMinWorkingSet
Gets or sets the minimum allowable working set size for the associated process.
(Inherited from Process.)
Public propertyNonpagedSystemMemorySize Obsolete.
Gets the nonpaged system memory size allocated to this process.
(Inherited from Process.)
Public propertyNonpagedSystemMemorySize64
Gets the amount of nonpaged system memory allocated for the associated process.
(Inherited from Process.)
Public propertyPagedMemorySize Obsolete.
Gets the paged memory size.
(Inherited from Process.)
Public propertyPagedMemorySize64
Gets the amount of paged memory allocated for the associated process.
(Inherited from Process.)
Public propertyPagedSystemMemorySize Obsolete.
Gets the paged system memory size.
(Inherited from Process.)
Public propertyPagedSystemMemorySize64
Gets the amount of pageable system memory allocated for the associated process.
(Inherited from Process.)
Public propertyPeakPagedMemorySize Obsolete.
Gets the peak paged memory size.
(Inherited from Process.)
Public propertyPeakPagedMemorySize64
Gets the maximum amount of memory in the virtual memory paging file used by the associated process.
(Inherited from Process.)
Public propertyPeakVirtualMemorySize Obsolete.
Gets the peak virtual memory size.
(Inherited from Process.)
Public propertyPeakVirtualMemorySize64
Gets the maximum amount of virtual memory used by the associated process.
(Inherited from Process.)
Public propertyPeakWorkingSet Obsolete.
Gets the peak working set size for the associated process.
(Inherited from Process.)
Public propertyPeakWorkingSet64
Gets the maximum amount of physical memory used by the associated process.
(Inherited from Process.)
Public propertyPriorityBoostEnabled
Gets or sets a value indicating whether the associated process priority should temporarily be boosted by the operating system when the main window has the focus.
(Inherited from Process.)
Public propertyPriorityClass
Gets or sets the overall priority category for the associated process.
(Inherited from Process.)
Public propertyPrivateMemorySize Obsolete.
Gets the private memory size.
(Inherited from Process.)
Public propertyPrivateMemorySize64
Gets the amount of private memory allocated for the associated process.
(Inherited from Process.)
Public propertyPrivilegedProcessorTime
Gets the privileged processor time for this process.
(Inherited from Process.)
Public propertyProcessName
Gets the name of the process.
(Inherited from Process.)
Public propertyProcessorAffinity
Gets or sets the processors on which the threads in this process can be scheduled to run.
(Inherited from Process.)
Public propertyResponding
Gets a value indicating whether the user interface of the process is responding.
(Inherited from Process.)
Public propertySessionId
Gets the Terminal Services session identifier for the associated process.
(Inherited from Process.)
Public propertyStartTime
Gets the time that the associated process was started.
(Inherited from Process.)
Public propertyTotalProcessorTime
Gets the total processor time for this process.
(Inherited from Process.)
Public propertyUserProcessorTime
Gets the user processor time for this process.
(Inherited from Process.)
Public propertyVirtualMemorySize Obsolete.
Gets the size of the process's virtual memory.
(Inherited from Process.)
Public propertyVirtualMemorySize64
Gets the amount of the virtual memory allocated for the associated process.
(Inherited from Process.)
Public propertyWorkingSet Obsolete.
Gets the associated process's physical memory usage.
(Inherited from Process.)
Public propertyWorkingSet64
Gets the amount of physical memory allocated for the associated process.
(Inherited from Process.)
Top
Methods

  NameDescription
Public methodBeginErrorReadLine
Begins asynchronous read operations on the redirected StandardError stream of the application.
(Inherited from Process.)
Public methodBeginOutputReadLine
Begins asynchronous read operations on the redirected StandardOutput stream of the application.
(Inherited from Process.)
Public methodCancelErrorRead
Cancels the asynchronous read operation on the redirected StandardError stream of an application.
(Inherited from Process.)
Public methodCancelOutputRead
Cancels the asynchronous read operation on the redirected StandardOutput stream of an application.
(Inherited from Process.)
Public methodClose
Frees all the resources that are associated with this component.
(Inherited from Process.)
Public methodCloseMainWindow
Closes a process that has a user interface by sending a close message to its main window.
(Inherited from Process.)
Public methodCreateObjRef
Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
(Inherited from MarshalByRefObject.)
Public methodDisableTypeMockOnProcess
Disable Typemock Isolator on process
Public methodStatic memberDisableTypeMockOnProcess(Process)
Disable Typemock Isolator on process
Public methodDispose
Releases all resources used by the Component.
(Inherited from Component.)
Protected methodDispose(Boolean)
Note: Dispose is already implemented by Process base class
(Overrides ProcessDispose(Boolean).)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Releases unmanaged resources and performs other cleanup operations before the Component is reclaimed by garbage collection.
(Inherited from Component.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetLifetimeService
Retrieves the current lifetime service object that controls the lifetime policy for this instance.
(Inherited from MarshalByRefObject.)
Protected methodGetService
Returns an object that represents a service provided by the Component or by its Container.
(Inherited from Component.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodInitializeLifetimeService
Obtains a lifetime service object to control the lifetime policy for this instance.
(Inherited from MarshalByRefObject.)
Public methodIsEnabled
Use to determain if Typemock Isolator is enabled on process
Public methodStatic memberIsEnabled(Process)
Use to determain if Typemock Isolator is enabled on process
Public methodKill
Immediately stops the associated process.
(Inherited from Process.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodMemberwiseClone(Boolean)
Creates a shallow copy of the current MarshalByRefObject object.
(Inherited from MarshalByRefObject.)
Protected methodOnExited
Raises the Exited event.
(Inherited from Process.)
Public methodPrepareTypeMockProcess
Enable Typemock Isolator on process
Public methodStatic memberPrepareTypeMockProcess(Process)
Enables Typemock Isolator on process
Public methodRefresh
Discards any information about the associated process that has been cached inside the process component.
(Inherited from Process.)
Public methodStart
Starts new process with Typemock Isolator enabled
Public methodStatic memberStart(ProcessStartInfo)
Starts new process with Typemock Isolator enabled
Public methodStatic memberStart(String)
Starts new process with Typemock Isolator enabled.
Public methodStatic memberStart(ProcessStartInfo, Boolean)
Public methodStatic memberStart(ProcessStartInfo, String)
Starts new process with Typemock Isolator enabled and a coverage profiler linked
Public methodStatic memberStart(String, String)
Starts new process with Typemock Isolator enabled.
Public methodStatic memberStart(ProcessStartInfo, String, Boolean)
Public methodToString
Formats the process's name as a string, combined with the parent component type, if applicable.
(Inherited from Process.)
Public methodStatic memberUnlinkWithCovarage
Unlinks coverage profiler
Public methodWaitForExit
Instructs the Process component to wait indefinitely for the associated process to exit.
(Inherited from Process.)
Public methodWaitForExit(Int32)
Instructs the Process component to wait the specified number of milliseconds for the associated process to exit.
(Inherited from Process.)
Public methodWaitForInputIdle
Causes the Process component to wait indefinitely for the associated process to enter an idle state. This overload applies only to processes with a user interface and, therefore, a message loop.
(Inherited from Process.)
Public methodWaitForInputIdle(Int32)
Causes the Process component to wait the specified number of milliseconds for the associated process to enter an idle state. This overload applies only to processes with a user interface and, therefore, a message loop.
(Inherited from Process.)
Top
Events

  NameDescription
Public eventErrorDataReceived
Occurs when an application writes to its redirected StandardError stream.
(Inherited from Process.)
Public eventExited
Occurs when a process exits.
(Inherited from Process.)
Public eventOutputDataReceived
Occurs when an application writes to its redirected StandardOutput stream.
(Inherited from Process.)
Top
Remarks

Using TypeMockProcess developers can enable running Processes with Typemock Isolator, Check if Typemock Isolator is enabled on Process and link Typemock Isolator with coverage tool.
Note Note
All actions that are on process object should be before the process starts running
Examples

Example using TypeMockProcess
C#
public void RunTest()
{
    ProcessStartInfo info = new ProcessStartInfo(UnitTestRunner, UnitTestRunnerParams); 
    using(typeMockProcess.Start(info))
    {                
    }
}
See Also

Reference