There is a class that performs the dividing logic in a column, the results of the calculation are stored in its variables.
public class IntegerDivisionLogic { private Integer dividend; private Integer divisor; private int quotient; private ArrayList<Integer> remaindersCollection = new ArrayList<>(); Next, the IntegerDivisionLogic class transfers all the data to the .json file.
{ "dividend": 12341234, "divisor": 1234, "quotient": 10001, "remaindersCollection": [ 1234, 1234, 1234, 1234, 0 ] } After that, the IntegerDivisionDrawer drawing class reads data from .json, recording it in its fields.
public class IntegerDivisionDrawer { private Integer dividend; private Integer divisor; private Integer quotient; private ArrayList<Integer> remaindersCollection = new ArrayList<>(); Based on the data builds the algorithm for drawing division.
String drawIntegerDivision() { buildHead(); buildBody(); buildTail(); return result.toString(); } You need to write unit tests for the IntegerDivisionDrawer class using the mockito, (they say the easiest way). But I do not know where to start writing and how to approach it. For for the class IntegerDivisionLogic tests are written.