Skip to content

Commit c2cae98

Browse files
committed
Updated unit tests
1 parent 920236f commit c2cae98

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

Tests/CoreModelTests/NSPredicateTests.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,14 @@ class EventObject: NSObject {
184184
self.speakers = speakers
185185
super.init()
186186
}
187+
188+
enum CodingKeys: String, CodingKey, CaseIterable, Sendable {
189+
190+
case id
191+
case name
192+
case start
193+
case speakers
194+
}
187195
}
188196

189197
@objc(Attributes)

Tests/CoreModelTests/SortDescriptorTests.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,13 @@ import Testing
5353
]
5454

5555
let sort = SortDescriptor(\EventObject.id, order: .forward)
56-
56+
let sortDescriptor = FetchRequest.SortDescriptor(
57+
property: PropertyKey(EventObject.CodingKeys.id),
58+
ascending: true
59+
)
5760
let sortedEvents = events.sorted(using: sort)
58-
5961
#expect(sortedEvents.map(\.id) == [1, 2, 3])
62+
#expect(sortDescriptor == FetchRequest.SortDescriptor(sort))
6063
}
6164
}
6265
#endif

0 commit comments

Comments
 (0)