//
//  Fakes.swift
//  LeCountdown
//
//  Created by Laurent Morvillier on 17/02/2023.
//

import Foundation
import CoreData

extension Countdown {
    
    static func fake(context: NSManagedObjectContext) -> Countdown {
        let cd = Countdown(context: context)
        cd.duration = 4 * 60.0
        let activity = Activity(context: context)
        activity.name = "Tea"
        cd.activity = activity
        return cd
    }
    
}

extension Alarm {
    
    static func fake(context: NSManagedObjectContext) -> Alarm {
        let alarm = Alarm(context: context)
        alarm.fireDate = Date()
        let activity = Activity(context: context)
        activity.name = "Wakeup"
        alarm.activity = activity
        return alarm
    }

}

extension Activity {
    
    static func fake(context: NSManagedObjectContext) -> Activity {
        let activity = Activity(context: context)
        activity.name = "Tea"
        return activity
    }
    
}
