Add tests

Depends on #1.
switch/case is more appropriate here?