Added unit tests for createScoped method