Add the first resource exception test
Better diagnostics of UnexpectedState
Add a missing case to destroyResources
Add a missing case to getResource
Fix initResources
Minor style fix
Modify exception test
Add a couple of resource tests and improve existing ones