Replace Order unit tests

1. added unit tests for replace order function