Added some unit tests for iState