//
//  WiredCameraTransferHelpDocumentTests.swift
//  suixinkanTests
//

import XCTest
@testable import suixinkan

/// 有线相机传输内置帮助文档资源测试。
final class WiredCameraTransferHelpDocumentTests: XCTestCase {
    func testBundledHelpHTMLExists() {
        let url = WiredCameraTransferHelpDocument.bundledURL()
        XCTAssertNotNil(url)
        XCTAssertEqual(url?.pathExtension, "html")
        XCTAssertTrue(url?.lastPathComponent.hasPrefix(WiredCameraTransferHelpDocument.resourceName) == true)
    }

    func testBundledHelpHTMLContainsCoreSections() throws {
        let url = try XCTUnwrap(WiredCameraTransferHelpDocument.bundledURL())
        let html = try String(contentsOf: url, encoding: .utf8)
        XCTAssertTrue(html.contains("有线相机传输帮助"))
        XCTAssertTrue(html.contains("连接相机"))
        XCTAssertTrue(html.contains("边拍边传"))
        XCTAssertTrue(html.contains("拍后传输"))
        XCTAssertTrue(html.contains("历史导入"))
        XCTAssertTrue(html.contains("索尼相机说明"))
        XCTAssertTrue(html.contains("常见问题"))
    }

    func testPageTitle() {
        XCTAssertEqual(WiredCameraTransferHelpDocument.pageTitle, "帮助文档")
    }
}
