# 36. Write unit tests for iOS business logic meta: id: native-business-logic-migration-36 feature: native-business-logic-migration priority: P1 depends_on: [native-business-logic-migration-33] tags: [testing, ios] objective: - Write comprehensive unit tests for iOS business logic deliverables: - FeedParserTests.swift (already exists) - FeedFetcherTests.swift (already exists) - DatabaseTests.swift (already exists) - RepositoryTests.swift (new - needs implementation) - ViewModelTests.swift (new - needs implementation) - BackgroundSyncTests.swift (new - needs implementation) - SearchServiceTests.swift (new - needs implementation) - NotificationServiceTests.swift (new - needs implementation) tests: - Unit: FeedParser, FeedFetcher, Database, SearchHistory, SearchQuery, SyncScheduler (existing) - Unit: Repository, ViewModel, BackgroundSync, SearchService, NotificationService (to be implemented) - Coverage: >80% code coverage (target) acceptance_criteria: - All business logic covered - Edge cases tested - Error cases tested - Performance tests included - >80% code coverage validation: - Run `xcodebuild test` - Check coverage report notes: - Use XCTest framework - Use XCTestExpectations for async - Mock external dependencies