Closed kyohaifeng closed 3 years ago
Hello, @kyohaifeng, Can you tell which OS you run this test? Because I added pipelines to run tests on different OS(Windows, Ubuntu, MacOS) and I saw that same issues reproduced on Ubuntu and MacOS, but for Windows is OK https://github.com/SvetlovA/static-mock/actions/runs/1007386703.
Hi, @SvetlovA ,I tested it by Windows OS with X64 and X86 platform,but all of them were Exceptional Sorry, I used debug mode to test, so there was an exception. When using run mode, there is no problem with testing. I don't understand why there are exceptions in debug mode
It depends on many different things. Compiler use some optimizations in Release mode. Also it depends on your processor architecture. Can you send me your processor info like in screen? And I will try to reproduce and fix it
I fixed it. This was error in tests. Return type of method is Task\<int>, but we try to mock int. Ubuntu and MacOS fail tests on run as expected. But it is really interesting Windows behavior, that we can see error only in debug mode. Fix commit: https://github.com/SvetlovA/static-mock/commit/8b396ff5c0d22d3b3b625dceeb6b4d782808e182 Test results: https://github.com/SvetlovA/static-mock/actions/runs/1011695756
@SvetlovA ,Hi, this is my computer spec.
Hi, @SvetlovA ,The following exception occurred when using the function of Setup(Type type, string methodName, Action action) to unit test a task function, but these is ok when using the function of generic Setup.