package com.ruoyi.web.modules.openstats.support;

import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.Test;

class AddressCityParserTest
{
    @Test
    void parseCity_municipalityDirectly()
    {
        assertEquals("北京市", AddressCityParser.parseCity("北京市朝阳区 某街道"));
    }

    @Test
    void parseCity_provinceCityDistrict()
    {
        assertEquals("深圳市", AddressCityParser.parseCity("广东省深圳市南山区 科技园"));
    }

    @Test
    void parseCity_blankReturnsUnknown()
    {
        assertEquals("未知", AddressCityParser.parseCity(""));
        assertEquals("未知", AddressCityParser.parseCity(null));
    }

    @Test
    void parseCity_unrecognizedReturnsUnknown()
    {
        assertEquals("未知", AddressCityParser.parseCity("科技园"));
    }
}
