Use this type when mocking global functions
Namespace: TypeMock
Assembly: TypeMock (in TypeMock.dll) Version: 9.3.6.0 (9.3.6.0)
Syntax
Return Value
Type: MockNew Mock Object
Remarks
Examples
// Managed C++ namespace TestWithCpp { int globalFunction(int a) {return a;} }
// Managed C++ [Test] void Global() { Mock* mock = MockManager::MockGlobalFunctions(); // Notice the '.' and NOT '::' !!! mock->ExpectAndReturn("TestWithCpp<b>.</b>globalFunction",__box(5)); Assert::AreEqual(__box(5), __box(globalFunction(4))); }
See Also