unit test for word counter