<?php

namespace Tests\Services\ProvinceService\FindByNameTest;

use App\Province;
use App\Services\ProvinceService;
use Tests\TestCase;

class FindByNameTest extends TestCase
{
    /** @var ProvinceService $provinceService */
    public $provinceService;

    public function setUp(): void
    {
        parent::setUp();
        $this->provinceService = app(ProvinceService::class);
    }

    public function testFindByName()
    {
        $province_name = '江苏省';
        $province = $this->provinceService->findByName($province_name);
        $_province = Province::query()->where('name','like','江苏'.'%')->first();
        $this->assertEquals($province,$_province);
    }
}
