43 lines
1.4 KiB
Swift
43 lines
1.4 KiB
Swift
import Testing
|
|
@testable import ICalSync
|
|
|
|
@Suite("ICalSync")
|
|
struct ICalSyncTests {
|
|
@Test("calendarTypeString covers all known cases")
|
|
func calendarTypeStrings() {
|
|
// Smoke test — ensure module compiles and exports expected types
|
|
let stats = ICalSyncStats()
|
|
#expect(stats.calendarCount == 0)
|
|
#expect(stats.eventCount == 0)
|
|
}
|
|
|
|
@Test("SyncEventPayload dictionary round-trip")
|
|
func eventPayloadDictionary() {
|
|
let payload = SyncEventPayload(
|
|
eventIdentifier: "abc-123",
|
|
calendarIdentifier: "cal-1",
|
|
title: "Test Event",
|
|
notes: nil,
|
|
location: "San Francisco",
|
|
url: nil,
|
|
isAllDay: false,
|
|
startDate: "2026-04-18T10:00:00Z",
|
|
endDate: "2026-04-18T11:00:00Z",
|
|
createdAt: nil,
|
|
modifiedAt: nil,
|
|
status: "confirmed",
|
|
availability: "busy",
|
|
isDetached: false,
|
|
hasAlarms: false,
|
|
hasRecurrenceRules: false,
|
|
recurrenceRule: nil,
|
|
organizerEmail: nil,
|
|
organizerName: nil,
|
|
attendeeCount: 0
|
|
)
|
|
let dict = payload.dictionary
|
|
#expect(dict["eventIdentifier"] as? String == "abc-123")
|
|
#expect(dict["title"] as? String == "Test Event")
|
|
#expect(dict["location"] as? String == "San Francisco")
|
|
}
|
|
}
|