You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would appear that StreamWriter.WriteLine calls its underlying stream's Write(ReadOnlySpan<> buffer) method, which Moq cannot mock (because its underlying library, DynamicProxy, cannot intercept it). That's an architectural limitation in both DynamicProxy and Moq; there's nothing that can be done about it. You'll likely need to create a mock Stream manually.
Getting below issue in MOQ unit test after upgrading the framework from 3.1 to 6.
Message:
System.InvalidProgramException : Cannot create boxed ByRef-like values.
Stack Trace:
Test Code: (Same code is working fine in .net core 3.1 but failing with below exception in .net 6)
The text was updated successfully, but these errors were encountered: