//
//  ScenicDistanceCalculatorTests.swift
//  suixinkanTests
//

import XCTest
@testable import suixinkan

/// 景区距离计算测试。
final class ScenicDistanceCalculatorTests: XCTestCase {

    func testDistanceKilometersBetweenKnownPoints() {
        // 北京天安门 ~ 故宫，约 0.9km
        let km = ScenicDistanceCalculator.distanceKilometers(
            fromLat: 39.9087,
            fromLng: 116.3975,
            toLat: 39.9163,
            toLng: 116.3972
        )
        XCTAssertGreaterThan(km, 0.5)
        XCTAssertLessThan(km, 1.5)
    }

    func testFormatDistanceKilometers() {
        XCTAssertEqual(ScenicDistanceCalculator.formatDistanceKilometers(1.234), "1.23")
        XCTAssertEqual(ScenicDistanceCalculator.formatDistanceKilometers(0), "0")
    }
}
