Added test case for 'replace' method

Added test case for 'replace' method.