I understand what's going on here, but have 2 questions (stack trace below)
1. how to track down the origin, the stack trace isn't helpful determining what fake/object has the uninit. field ?
2. how to disable this "Verfiying". I didn't setup any expectations or strict checks on this object, I'd rather ignore this, as my test is fine and passes,
but I can't have this exception throwing.
One of the background threads threw exception: TypeMock.VerifyException:
TypeMock Verification: The call to System.Net.Sockets.NetworkStream.Finalize() was made on an uninitialized field.
at c9.a(Object A_0, String A_1, String A_2, MethodBase A_3, Object[] A_4, Object A_5)
at TypeMock.MockManager.a(String A_0, String A_1, Object A_2, Object A_3, Boolean A_4, Object[] A_5)
at TypeMock.InternalMockManager.getReturn(Object that, String typeName, String methodName, Object methodParameters, Boolean isInjected)
at System.Net.Sockets.NetworkStream.Finalize()
Test host process exited unexpectedly.
I am using a TcpListener and tried this to no avail.
TcpListener listener = Isolate.Fake.Instance<TcpListener>();
Isolate.WhenCalled(() => listener.Server).WillReturn(Isolate.Fake.Instance<Socket>());
p.s. This is also causing my code coverage/mstest to blow up. :(
Thanks for the help.