Writing a test to verify swapping of the function