complete unit test from answer