Refactored tests to use shared examples