Refactored createResource method
Tests was refactosred
Tests was refactored. Added test for testing case when resource created without name