Add PlantGuide iOS app with plant identification and care management

- Implement camera capture and plant identification workflow
- Add Core Data persistence for plants, care schedules, and cached API data
- Create collection view with grid/list layouts and filtering
- Build plant detail views with care information display
- Integrate Trefle botanical API for plant care data
- Add local image storage for captured plant photos
- Implement dependency injection container for testability
- Include accessibility support throughout the app

Bug fixes in this commit:
- Fix Trefle API decoding by removing duplicate CodingKeys
- Fix LocalCachedImage to load from correct PlantImages directory
- Set dateAdded when saving plants for proper collection sorting

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-01-23 12:18:01 -06:00
parent d3ab29eb84
commit 136dfbae33
187 changed files with 69001 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
//
// 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
}
}