I verified, that the object passed to Marshal is my Mock-Object. When passed to Marshal, do all Properties of the Mock-Object have to be set?
I have not found any information on how Marshal is exactly releasing the COM-Object.
Setting Expectations for all properties and variables of the mocked Object would be a lot of work, because it is quite similar of what is called god class.
The Exception details are the following:
System.ArgumentException was unhandled
Message="Der Objekttyp muss __ComObject sein oder von __ComObject abgeleitet werden.
Parametername: o"
Source="mscorlib"
ParamName="o"
StackTrace:
bei System.Runtime.InteropServices.Marshal.ReleaseComObject(Object o)
bei Lock.Unlock() in D:..Path..Lock.cs:Zeile 194.
bei Lock.Dispose(Boolean disposing) in D:PathLock.cs:Zeile 240.
bei Lock.Finalize() in D:..Path..Lock.cs:Zeile 253.
...which looks not very helpful to me.
I am a student trying to develop a proof of concept on how to do unit testing for a company and i am actually working with the trial version of TypeMock, which is so far the best possibility to unit test the code i have found. I am not allowed to post or send any productive code and trying to reengineer a dummy-solution would mean reinventing the wheel.