Mocking data sources using partial functions