Rework the internal machinery of mock macro
Fix test to test the expected result