fix: issue #17 - upcoming tasks
Automated fix by Tony CI v3. Refs #17 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -86,9 +86,11 @@ final class MockCoreDataStack: CoreDataStackProtocol, @unchecked Sendable {
|
||||
let entityNames = persistentContainer.managedObjectModel.entities.compactMap { $0.name }
|
||||
|
||||
for entityName in entityNames {
|
||||
let fetchRequest = NSFetchRequest<NSFetchRequestResult>(entityName: entityName)
|
||||
let deleteRequest = NSBatchDeleteRequest(fetchRequest: fetchRequest)
|
||||
try context.execute(deleteRequest)
|
||||
let fetchRequest = NSFetchRequest<NSManagedObject>(entityName: entityName)
|
||||
let objects = try context.fetch(fetchRequest)
|
||||
for object in objects {
|
||||
context.delete(object)
|
||||
}
|
||||
}
|
||||
|
||||
try save(context: context)
|
||||
|
||||
@@ -143,7 +143,7 @@ struct MockImagePreprocessor: ImagePreprocessorProtocol, Sendable {
|
||||
// MARK: - MockIdentifyPlantUseCase
|
||||
|
||||
/// Mock implementation of IdentifyPlantUseCaseProtocol for testing
|
||||
struct MockIdentifyPlantUseCase: IdentifyPlantUseCaseProtocol, Sendable {
|
||||
final class MockIdentifyPlantUseCase: IdentifyPlantUseCaseProtocol, @unchecked Sendable {
|
||||
|
||||
// MARK: - Configuration
|
||||
|
||||
@@ -167,7 +167,7 @@ struct MockIdentifyPlantUseCase: IdentifyPlantUseCaseProtocol, Sendable {
|
||||
|
||||
/// Creates a mock that returns high-confidence predictions
|
||||
static func withHighConfidencePredictions() -> MockIdentifyPlantUseCase {
|
||||
var mock = MockIdentifyPlantUseCase()
|
||||
let mock = MockIdentifyPlantUseCase()
|
||||
mock.predictionsToReturn = [
|
||||
ViewPlantPrediction(
|
||||
id: UUID(),
|
||||
@@ -181,7 +181,7 @@ struct MockIdentifyPlantUseCase: IdentifyPlantUseCaseProtocol, Sendable {
|
||||
|
||||
/// Creates a mock that returns low-confidence predictions
|
||||
static func withLowConfidencePredictions() -> MockIdentifyPlantUseCase {
|
||||
var mock = MockIdentifyPlantUseCase()
|
||||
let mock = MockIdentifyPlantUseCase()
|
||||
mock.predictionsToReturn = [
|
||||
ViewPlantPrediction(
|
||||
id: UUID(),
|
||||
@@ -195,7 +195,7 @@ struct MockIdentifyPlantUseCase: IdentifyPlantUseCaseProtocol, Sendable {
|
||||
|
||||
/// Creates a mock that throws an error
|
||||
static func withError(_ error: Error = IdentifyPlantOnDeviceUseCaseError.noMatchesFound) -> MockIdentifyPlantUseCase {
|
||||
var mock = MockIdentifyPlantUseCase()
|
||||
let mock = MockIdentifyPlantUseCase()
|
||||
mock.shouldThrow = true
|
||||
mock.errorToThrow = error
|
||||
return mock
|
||||
@@ -205,7 +205,7 @@ struct MockIdentifyPlantUseCase: IdentifyPlantUseCaseProtocol, Sendable {
|
||||
// MARK: - MockIdentifyPlantOnlineUseCase
|
||||
|
||||
/// Mock implementation of IdentifyPlantOnlineUseCaseProtocol for testing
|
||||
struct MockIdentifyPlantOnlineUseCase: IdentifyPlantOnlineUseCaseProtocol, Sendable {
|
||||
final class MockIdentifyPlantOnlineUseCase: IdentifyPlantOnlineUseCaseProtocol, @unchecked Sendable {
|
||||
|
||||
// MARK: - Configuration
|
||||
|
||||
@@ -229,7 +229,7 @@ struct MockIdentifyPlantOnlineUseCase: IdentifyPlantOnlineUseCaseProtocol, Senda
|
||||
|
||||
/// Creates a mock that returns API predictions
|
||||
static func withPredictions() -> MockIdentifyPlantOnlineUseCase {
|
||||
var mock = MockIdentifyPlantOnlineUseCase()
|
||||
let mock = MockIdentifyPlantOnlineUseCase()
|
||||
mock.predictionsToReturn = [
|
||||
ViewPlantPrediction(
|
||||
id: UUID(),
|
||||
@@ -243,7 +243,7 @@ struct MockIdentifyPlantOnlineUseCase: IdentifyPlantOnlineUseCaseProtocol, Senda
|
||||
|
||||
/// Creates a mock that throws an error
|
||||
static func withError(_ error: Error = IdentifyPlantOnlineUseCaseError.noMatchesFound) -> MockIdentifyPlantOnlineUseCase {
|
||||
var mock = MockIdentifyPlantOnlineUseCase()
|
||||
let mock = MockIdentifyPlantOnlineUseCase()
|
||||
mock.shouldThrow = true
|
||||
mock.errorToThrow = error
|
||||
return mock
|
||||
|
||||
Reference in New Issue
Block a user