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 EquivalentLengthTests {
|
||||
|
||||
@@ -76,4 +77,47 @@ struct EquivalentLengthTests {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test(
|
||||
arguments: [
|
||||
EquivalentLength.Create(
|
||||
projectID: UUID(0), name: "", type: .return, straightLengths: [], groups: []
|
||||
),
|
||||
EquivalentLength.Create(
|
||||
projectID: UUID(0), name: "Testy", type: .return, straightLengths: [-1, 1], groups: []
|
||||
),
|
||||
EquivalentLength.Create(
|
||||
projectID: UUID(0), name: "Testy", type: .return, straightLengths: [1, -1], groups: []
|
||||
),
|
||||
EquivalentLength.Create(
|
||||
projectID: UUID(0), name: "Testy", type: .return, straightLengths: [1, 1],
|
||||
groups: [
|
||||
.init(group: -1, letter: "a", value: 1.0, quantity: 1)
|
||||
]
|
||||
),
|
||||
EquivalentLength.Create(
|
||||
projectID: UUID(0), name: "Testy", type: .return, straightLengths: [1, 1],
|
||||
groups: [
|
||||
.init(group: 1, letter: "1", value: 1.0, quantity: 1)
|
||||
]
|
||||
),
|
||||
EquivalentLength.Create(
|
||||
projectID: UUID(0), name: "Testy", type: .return, straightLengths: [1, 1],
|
||||
groups: [
|
||||
.init(group: 1, letter: "a", value: -1.0, quantity: 1)
|
||||
]
|
||||
),
|
||||
EquivalentLength.Create(
|
||||
projectID: UUID(0), name: "Testy", type: .return, straightLengths: [1, 1],
|
||||
groups: [
|
||||
.init(group: 1, letter: "a", value: 1.0, quantity: -1)
|
||||
]
|
||||
),
|
||||
]
|
||||
)
|
||||
func validations(model: EquivalentLength.Create) {
|
||||
#expect(throws: (any Error).self) {
|
||||
try model.toModel().validate()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user