Add unit tests for kingdom
Add unit tests for kingdom