feat: Updates to use swift-validations for database.
All checks were successful
CI / Linux Tests (push) Successful in 6m28s
All checks were successful
CI / Linux Tests (push) Successful in 6m28s
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import DatabaseClient
|
||||
import Dependencies
|
||||
import Foundation
|
||||
import ManualDCore
|
||||
import Testing
|
||||
|
||||
@testable import DatabaseClient
|
||||
|
||||
@Suite
|
||||
struct TrunkSizeTests {
|
||||
|
||||
@@ -64,4 +65,29 @@ struct TrunkSizeTests {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test(
|
||||
arguments: [
|
||||
TrunkModel(projectID: UUID(0), type: .return, height: 8, name: ""),
|
||||
TrunkModel(projectID: UUID(0), type: .return, height: -8, name: "Test"),
|
||||
]
|
||||
)
|
||||
func validations(model: TrunkModel) {
|
||||
#expect(throws: (any Error).self) {
|
||||
try model.validate()
|
||||
}
|
||||
}
|
||||
|
||||
@Test(
|
||||
arguments: [
|
||||
TrunkRoomModel(trunkID: UUID(0), roomID: UUID(0), registers: [-1, 1], type: .return),
|
||||
TrunkRoomModel(trunkID: UUID(0), roomID: UUID(0), registers: [1, -1], type: .return),
|
||||
TrunkRoomModel(trunkID: UUID(0), roomID: UUID(0), registers: [], type: .return),
|
||||
]
|
||||
)
|
||||
func trunkRoomModelValidations(model: TrunkRoomModel) {
|
||||
#expect(throws: (any Error).self) {
|
||||
try model.validate()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user