You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
961 B
29 lines
961 B
import Foundation
|
|
import Testing
|
|
@testable import MusubiCore
|
|
|
|
@Suite struct ModelTests {
|
|
@Test func sceneRoundTripsThroughJSON() throws {
|
|
let pgm = Source(ndiName: "ZOWIEBOX-PGM (PGM)")
|
|
let scene = Scene(name: "OP-Live", role: .node, routes: [
|
|
Route(source: pgm, output: .screen(displayID: 2), mode: .videoOnly),
|
|
Route(source: pgm, output: .audioChannel(deviceUID: "MOTU-M2", channel: 2), mode: .audioOnly),
|
|
])
|
|
|
|
let data = try JSONEncoder().encode(scene)
|
|
let decoded = try JSONDecoder().decode(Scene.self, from: data)
|
|
|
|
#expect(decoded == scene)
|
|
}
|
|
|
|
@Test(arguments: [
|
|
("ZOWIEBOX-PGM (PGM)", "PGM"),
|
|
("MACBOOK (Test Pattern)", "Test Pattern"),
|
|
("NoParens", "NoParens"),
|
|
("EMPTY ()", "EMPTY ()"),
|
|
])
|
|
func defaultLabelUsesStreamName(ndiName: String, expected: String) {
|
|
#expect(Source.defaultLabel(for: ndiName) == expected)
|
|
}
|
|
}
|