<?php

namespace Kylin\Payment\Tests\Unit;

use Illuminate\Foundation\Testing\TestCase;
use Kylin\Payment\Facades\Payment;
use Kylin\Payment\Payment as PaymentClass;

class PaymentFacadeTest extends TestCase
{
    /**
     * 测试支付门面是否正常工作
     */
    public function testPaymentFacadeResolvesCorrectly()
    {
        $this->assertInstanceOf(PaymentClass::class, Payment::getFacadeRoot());
    }

    /**
     * 测试支付门面的静态方法
     */
    public function testPaymentFacadeStaticMethods()
    {
        // 测试获取支付管理器
        $manager = Payment::manager();
        $this->assertNotNull($manager);

        // 测试获取支付记录服务
        $paymentRecordService = Payment::paymentRecord();
        $this->assertNotNull($paymentRecordService);

        // 测试获取回调日志服务
        $callbackLogService = Payment::callbackLog();
        $this->assertNotNull($callbackLogService);

        // 测试获取支付统计服务
        $statisticsService = Payment::statistics();
        $this->assertNotNull($statisticsService);

        // 测试获取语言服务
        $languageService = Payment::lang();
        $this->assertNotNull($languageService);

        // 测试获取配置缓存服务
        $configCacheService = Payment::configCache();
        $this->assertNotNull($configCacheService);

        // 测试获取队列服务
        $queueService = Payment::queue();
        $this->assertNotNull($queueService);

        // 测试获取支付场景服务
        $scenarioService = Payment::scenario();
        $this->assertNotNull($scenarioService);

        // 测试获取安全服务
        $securityService = Payment::security();
        $this->assertNotNull($securityService);

        // 测试获取版本管理服务
        $versionManagerService = Payment::version();
        $this->assertNotNull($versionManagerService);

        // 测试获取测试工具服务
        $testToolService = Payment::test();
        $this->assertNotNull($testToolService);

        // 测试获取通知服务
        $notificationService = Payment::notify();
        $this->assertNotNull($notificationService);

        // 测试获取二维码服务
        $qrCodeService = Payment::qrcode();
        $this->assertNotNull($qrCodeService);

        // 测试获取支付链接服务
        $paymentLinkService = Payment::link();
        $this->assertNotNull($paymentLinkService);

        // 测试获取分账服务
        $profitSharingService = Payment::sharing();
        $this->assertNotNull($profitSharingService);

        // 测试获取优惠券服务
        $couponService = Payment::coupon();
        $this->assertNotNull($couponService);

        // 测试获取报表服务
        $reportService = Payment::report();
        $this->assertNotNull($reportService);

        // 测试获取支付重试服务
        $paymentRetryService = Payment::retry();
        $this->assertNotNull($paymentRetryService);

        // 测试获取支付超时处理服务
        $paymentTimeoutService = Payment::timeout();
        $this->assertNotNull($paymentTimeoutService);

        // 测试获取支付预创建服务
        $paymentPreCreateService = Payment::preCreate();
        $this->assertNotNull($paymentPreCreateService);

        // 测试获取支付数据脱敏服务
        $paymentDataMaskingService = Payment::masking();
        $this->assertNotNull($paymentDataMaskingService);

        // 测试获取支付接口限流服务
        $paymentRateLimitService = Payment::rateLimit();
        $this->assertNotNull($paymentRateLimitService);

        // 测试获取支付Webhook服务
        $paymentWebhookService = Payment::webhook();
        $this->assertNotNull($paymentWebhookService);

        // 测试获取支付智能路由服务
        $paymentIntelligentRoutingService = Payment::routing();
        $this->assertNotNull($paymentIntelligentRoutingService);

        // 测试获取支付批量操作服务
        $paymentBatchOperationService = Payment::batch();
        $this->assertNotNull($paymentBatchOperationService);
    }
}
