Refactor ResorceFactoryTests