I try to use Isolator++ since in my opinion, it has the best and easiest faking possibilities.
I tried with Microsoft C++ Unit Tests, where Isolator works fine, but I didn't get the C++/CLR Bridge to a C# assembgly working right now.
So I am trying with google-test, where Isolator++ behaves differently and I haven't figured out why.
WHEN_CALLED
_
cannot convert from int to whatever (const char*)
so I tried
ANY_VAL(const char*) // function does not take 0 arguements
and finally just a C-style cast
(const char*)(_)
WHEN_CALLED(::MyGlobalTrue((const char*)(_))).Return(false);
It compiles, however it fails with
********* Typemock Isolator++ Assert Exception *********
- The function 'MyGlobalTrueNoArgs' information cannot be found by Isolator++. Making the application's PDB accessible to Isolator++ will usually solve this problem. If the PDB's and the dll's are not in the same folder you can set the environment variable IPP_PDB_PATH to the path of the PDB's.You can set several folders separate with semicolon like this: set IPP_PDB_PATH="C:\Symbols;C:\Windows\Symbols"Otherwise please use FAKE_GLOBAL(MyGlobalTrueNoArgs) macro to make the function visible to Isolator++.To verify that the PDB is generated, please go to project settings->Linker->Debugging and set 'Generate Debug Info' to 'Yes'.Also make sure that in C++->General 'Debug Information Format' is set to 'Program Database'
**************************************
The PDB is in the folder and I also tried setting IPP_PDB_PATH.
The project in use can be found here:
https://github.com/relascope/TestingCppClrCs
Thanks for suggestions.