Add unit test for count method.
[ci skip]