velody/packages/apple/VelodyPlayback/Tests/VelodyPlaybackTests/PlaybackErrorTests.swift

31 lines
919 B
Swift

import XCTest
@testable import VelodyPlayback
final class PlaybackErrorTests: XCTestCase {
func testMissingLocalFileErrorDescriptionIncludesPath() {
let error = PlaybackError.missingLocalFile(path: "/tmp/missing-track.mp3")
XCTAssertEqual(
error.errorDescription,
"The local file could not be found: /tmp/missing-track.mp3"
)
XCTAssertEqual(
error.localizedDescription,
"The local file could not be found: /tmp/missing-track.mp3"
)
}
func testMissingLocalFileErrorDescriptionFallsBackForBlankPath() {
let error = PlaybackError.missingLocalFile(path: " ")
XCTAssertEqual(
error.errorDescription,
"The local file could not be found."
)
XCTAssertEqual(
error.localizedDescription,
"The local file could not be found."
)
}
}