It is a common practice to use mock framework in the setup phase of a unit test, in order to set the internal state of the dependent objects. Sometimes it is though easier to set a value of a given field directly, in order to test the class accordingly. For modifying field value via reflection,… Continue reading Using reflection in setup phase of unit testing