unit test working with bad practice