SvetlovA / static-mock

SMock is opensource lib for mocking static and instance methods and properties.
https://svetlova.github.io/static-mock/
MIT License
10 stars 3 forks source link

Async mocks throws error #10

Closed SvetlovA closed 1 year ago

SvetlovA commented 1 year ago

Async methods mock throws, on all test execution:

Exit code is -532462766 (Unhandled exception. Unhandled exception. Unhandled exception. Unhandled exception. Unhandled exception. Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
   at StaticMock.Tests.ReturnsTests.GenericSetupMockReturnsAsyncTests.<>c__DisplayClass5_0.<<TestGenericSetupReturnsWithTestMethodReturnParameterFuncAsync>b__1>d.MoveNext() in D:\MyProjects\static-mock\src\StaticMock.Tests\ReturnsTests\GenericSetupMockReturnsAsyncTests.cs:line 102
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state)
   at System.Threading.QueueUserWorkItemCallback.<>c.<.cctor>b__6_0(QueueUserWorkItemCallback quwi)
   at System.Threading.ExecutionContext.RunForThreadPoolUnsafe[TState](ExecutionContext executionContext, Action`1 callback, TState& state)
   at System.Threading.QueueUserWorkItemCallback.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
   at System.Threading.Thread.StartCallback()
SvetlovA commented 1 year ago

Was reproduce only in branch "HookParametrizeFunctions" and was already fixed as a part of parametrized hook feature