// // InMemoryPlantRepositoryTests.swift // PlantGuideTests // // Tests for InMemoryPlantRepository protocol conformance. // import XCTest @testable import PlantGuide final class InMemoryPlantRepositoryTests: XCTestCase { // MARK: - Protocol Conformance Tests func testConformsToPlantRepositoryProtocol() async { // This test verifies at compile time that InMemoryPlantRepository // conforms to PlantRepositoryProtocol let repo: PlantRepositoryProtocol = InMemoryPlantRepository.shared XCTAssertNotNil(repo) } func testConformsToPlantCollectionRepositoryProtocol() async { let repo: PlantCollectionRepositoryProtocol = InMemoryPlantRepository.shared XCTAssertNotNil(repo) } func testConformsToFavoritePlantRepositoryProtocol() async { let repo: FavoritePlantRepositoryProtocol = InMemoryPlantRepository.shared XCTAssertNotNil(repo) } // MARK: - Basic Operations Tests func testFetchAllReturnsPlants() async throws { let repo = InMemoryPlantRepository.shared let plants = try await repo.fetchAll() // In DEBUG mode, should have sample data seeded #if DEBUG XCTAssertFalse(plants.isEmpty, "Repository should have sample data in DEBUG mode") #endif } }