android - Is it possible to test a local value using a junit test? -
sometimes test intermediate value in method. method can't split. wonder if junit can test method unit. if can put breakpoint in method, , local value , assert it, better. if impossible, how solve kind of problem.
adding break point not unit testing , in fact not testing @ all. can call checking there no such thing check driven development.
anyhow, people new unit testing quite find issue want test private or local values let variable or method. when started tdd in fact quite phased myself. thing is, in unit testing purpose black box testing of particular functionality , possible outcomes that. happens inside black box not concern nor need unit test it.
if feel testing intermediate value maybe method long , should split 2 or more testable small methods. , if can not done should not worrying testing them.
if intermediate value getting value public method it's that method want test in separate unit test, not value inside method testing.
Comments
Post a Comment