//
//  TagsConfigurationTests.swift
//  ResgenSwift
//
//  Created by Thibaut Schmitt on 18/07/2025.
//

import Foundation
@testable import ResgenSwift
import XCTest

final class TagsConfigurationTests: XCTestCase {

    let projectDirectory = "projectDirectory/"
    
    func test_argsGeneration_requiredArgs() {
        // Given
        let testingConfiguration = TagsConfiguration(
            inputFile: "path/to/tags.txt",
            lang: "ium",
            extensionOutputPath: "Tags/Generated",
            extensionName: nil,
            extensionSuffix: nil,
            visibility: nil,
            staticMembers: nil
        )

        // When
        let arguments = testingConfiguration.getArguments(
            projectDirectory: projectDirectory,
            force: false
        )
                
        // Expect
        let expectedArguments = [
            "projectDirectory/path/to/tags.txt",
            "--lang",
            "ium",
            "--extension-output-path",
            "projectDirectory/Tags/Generated"
        ]

        XCTAssertEqual(arguments, expectedArguments)
    }
    
    func test_argsGeneration_allArguments() {
        // Given
        let testingConfiguration = TagsConfiguration(
            inputFile: "path/to/tags.txt",
            lang: "ium",
            extensionOutputPath: "Tags/Generated",
            extensionName: "AppTag",
            extensionSuffix: "Testing",
            visibility: "private",
            staticMembers: true
        )

        // When
        let arguments = testingConfiguration.getArguments(
            projectDirectory: projectDirectory,
            force: true
        )

        // Expect
        let expectedArguments = [
            "-f",
            "projectDirectory/path/to/tags.txt",
            "--lang",
            "ium",
            "--extension-output-path",
            "projectDirectory/Tags/Generated",
            "--extension-name",
            "AppTag",
            "--extension-suffix",
            "Testing",
            "--visibility",
            "private",
            "--static-members",
            "true"
        ]

        XCTAssertEqual(arguments, expectedArguments)
    }
}
