import XCTest @testable import FuelBoardShared /// User-facing copy: the Fuel Savings SORT is called "Best Value" (renamed on the /// user's instruction from "Worth the Drive"), while the feature that backs it /// keeps the name "Worth the Drive" in Settings and on the sheet. Pin both so /// neither drifts by accident. final class SortModeNamesTests: XCTestCase { func testSortModeNames() { XCTAssertEqual(SortMode.cheapest.displayName, "Cheapest") XCTAssertEqual(SortMode.closest.displayName, "Closest") XCTAssertEqual(SortMode.worthTheDrive.displayName, "Best Value") } func testRawValueIsUnchangedSoStoredPreferencesKeepDecoding() { // The label is copy; the raw value is persisted state. Renaming the one // must never move the other. XCTAssertEqual(SortMode.worthTheDrive.rawValue, "worthTheDrive") XCTAssertEqual(SortMode(rawValue: "worthTheDrive"), .worthTheDrive) XCTAssertEqual(SortMode.allCases.map(\.rawValue), ["cheapest", "closest", "worthTheDrive"]) } func testTheFeatureItselfIsStillCalledWorthTheDrive() { // Only the sort was renamed — the status wording the feature produces // keeps its own name. XCTAssertEqual(FuelSavingsStatus.worthTheDrive.displayName, "Worth the drive") XCTAssertEqual(FuelSavingsStatus.notWorthTheDrive.displayName, "Not worth the drive") } }