//
//  CameraTetheringSessionTests.swift
//  suixinkanTests
//

import XCTest
@testable import suixinkan

/// CameraTetheringSession 与 detach/shutdown 语义测试。
@MainActor
final class CameraTetheringSessionTests: XCTestCase {
    func testSharedServiceIsAutoDetectInstance() {
        XCTAssertTrue(CameraTetheringSession.sharedService is AutoDetectCameraService)
    }

    func testDetachFromUIClearsCallbacksWithoutChangingConnectionState() {
        let service = AutoDetectCameraService()
        service.onConnectionStateChange = { _ in }
        service.onNewAsset = { _ in }
        service.detachFromUI()
        XCTAssertNil(service.onConnectionStateChange)
        XCTAssertNil(service.onNewAsset)
    }
}
