//
//  DocumentHelpersTests.swift
//  honeyDueTests
//
//  Unit tests for DocumentTypeHelper and DocumentCategoryHelper.
//

import Testing
@testable import honeyDue

// MARK: - DocumentTypeHelper Tests

struct DocumentTypeHelperTests {

    @Test func warrantyDisplayName() {
        #expect(DocumentTypeHelper.displayName(for: "warranty") == "Warranty")
    }

    @Test func manualDisplayName() {
        #expect(DocumentTypeHelper.displayName(for: "manual") == "User Manual")
    }

    @Test func receiptDisplayName() {
        #expect(DocumentTypeHelper.displayName(for: "receipt") == "Receipt/Invoice")
    }

    @Test func inspectionDisplayName() {
        #expect(DocumentTypeHelper.displayName(for: "inspection") == "Inspection Report")
    }

    @Test func insuranceDisplayName() {
        #expect(DocumentTypeHelper.displayName(for: "insurance") == "Insurance")
    }

    @Test func permitDisplayName() {
        #expect(DocumentTypeHelper.displayName(for: "permit") == "Permit")
    }

    @Test func deedDisplayName() {
        #expect(DocumentTypeHelper.displayName(for: "deed") == "Deed/Title")
    }

    @Test func contractDisplayName() {
        #expect(DocumentTypeHelper.displayName(for: "contract") == "Contract")
    }

    @Test func photoDisplayName() {
        #expect(DocumentTypeHelper.displayName(for: "photo") == "Photo")
    }

    @Test func unknownTypeDefaultsToOther() {
        #expect(DocumentTypeHelper.displayName(for: "unknown") == "Other")
    }

    @Test func emptyTypeDefaultsToOther() {
        #expect(DocumentTypeHelper.displayName(for: "") == "Other")
    }

    @Test func allTypesArrayNotEmpty() {
        #expect(!DocumentTypeHelper.allTypes.isEmpty)
    }

    @Test func allTypesContainsWarranty() {
        #expect(DocumentTypeHelper.allTypes.contains("warranty"))
    }
}

// MARK: - DocumentCategoryHelper Tests

struct DocumentCategoryHelperTests {

    @Test func applianceDisplayName() {
        #expect(DocumentCategoryHelper.displayName(for: "appliance") == "Appliance")
    }

    @Test func hvacDisplayName() {
        #expect(DocumentCategoryHelper.displayName(for: "hvac") == "HVAC")
    }

    @Test func plumbingDisplayName() {
        #expect(DocumentCategoryHelper.displayName(for: "plumbing") == "Plumbing")
    }

    @Test func electricalDisplayName() {
        #expect(DocumentCategoryHelper.displayName(for: "electrical") == "Electrical")
    }

    @Test func roofingDisplayName() {
        #expect(DocumentCategoryHelper.displayName(for: "roofing") == "Roofing")
    }

    @Test func structuralDisplayName() {
        #expect(DocumentCategoryHelper.displayName(for: "structural") == "Structural")
    }

    @Test func landscapingDisplayName() {
        #expect(DocumentCategoryHelper.displayName(for: "landscaping") == "Landscaping")
    }

    @Test func generalDisplayName() {
        #expect(DocumentCategoryHelper.displayName(for: "general") == "General")
    }

    @Test func unknownCategoryDefaultsToOther() {
        #expect(DocumentCategoryHelper.displayName(for: "xyz") == "Other")
    }

    @Test func allCategoriesArrayNotEmpty() {
        #expect(!DocumentCategoryHelper.allCategories.isEmpty)
    }

    @Test func allCategoriesContainsHVAC() {
        #expect(DocumentCategoryHelper.allCategories.contains("hvac"))
    }
}
