[Contact] Refactor unit test

Here are four test cases to be performed. At the end of the test, four test flags will be examined to find out if the test is passed.