Home > other >  Unit test the mock
Unit test the mock

Time:09-23

Objective: through the unit test, test out in the configuration file is not defined in the key, whether flag is set on the

Before: define the flag defined directly in the class, below the get method, junit directly using the get method in the past the value of the flag, and then compared with expectations,

Problem: because the get method only need to test, for the code to run is meaningless, so there's no need for the get method, so now you need to get the flag in the mock way,

Small white technology, some professional comments, with reference to the other before test code, also did not write, beg god to give directions,
  • Related