Does anyone know the requirements for mocking .NET objects? Using New-MockObject works ok for something like System.Diagnostics.Process but not for System.Data.DataRow.
The mock appears to work but using GetType gives the error "The following exception occurred while retrieving member “GetType”: “Object reference not set to an instance of an object.”
New-MockObject just creates an object template of sorts but, as you have seen, is not a true object. I use New-MockObject all the time and if I need a method or property like GetType() I’ll do this: