25 lines
1.3 KiB
Swift
25 lines
1.3 KiB
Swift
import XCTest
|
|
@testable import MatchLiveTv
|
|
|
|
final class LiveBroadcastCoordinatorTests: XCTestCase {
|
|
func testShouldStopPreviousSessionFalseOnFirstLaunch() {
|
|
XCTAssertFalse(LiveBroadcastCoordinator.shouldStopPreviousSession(active: nil, incoming: "session-a"))
|
|
}
|
|
|
|
func testShouldStopPreviousSessionFalseForSameSession() {
|
|
XCTAssertFalse(LiveBroadcastCoordinator.shouldStopPreviousSession(active: "session-a", incoming: "session-a"))
|
|
}
|
|
|
|
func testShouldStopPreviousSessionTrueWhenSwitching() {
|
|
XCTAssertTrue(LiveBroadcastCoordinator.shouldStopPreviousSession(active: "session-a", incoming: "session-b"))
|
|
}
|
|
|
|
func testAudioMuteCommandFromCable() {
|
|
XCTAssertEqual(AudioMuteCommandLogic.muted(type: "command", action: "mute_audio", event: nil, muted: nil), true)
|
|
XCTAssertEqual(AudioMuteCommandLogic.muted(type: "command", action: "unmute_audio", event: nil, muted: nil), false)
|
|
XCTAssertNil(AudioMuteCommandLogic.muted(type: "command", action: "pause_stream", event: nil, muted: nil))
|
|
XCTAssertEqual(AudioMuteCommandLogic.muted(type: "stream_event", action: nil, event: "audio_muted", muted: true), true)
|
|
XCTAssertEqual(AudioMuteCommandLogic.muted(type: "stream_event", action: nil, event: "audio_muted", muted: false), false)
|
|
}
|
|
}
|