M
M
maxvinogradov2021-09-02 14:25:46
Java
maxvinogradov, 2021-09-02 14:25:46

Is declaring this variable pointless or does it improve the readability of the code?

var expectedResponseList = getEmployeeList();
        assertEquals(expectedResponseList, actualResponseList);

Or is it better to specify
assertEquals( getEmployeeList(), actualResponseList);


If getEmployeeList() is a static method that returns a sheet from the class where the models are stored for testing.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Roo, 2021-09-02
@maxvinogradov

With a separate variable, IMHO, better

O
Orkhan, 2021-09-03
Hasanly @azerphoenix

From the point of view of clean code, it is better to do it with a separate variable.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question