test_class.declarator: VALID_RESPONSE = "ProvinceName 0  CityName 0"
test_class.modifier: private static final
test_class.original_string: private static final String VALID_RESPONSE = "ProvinceName 0  CityName 0";
test_class.type: String
test_class.var_name: VALID_RESPONSE
test_class.declarator: EMPTY_PROVINCE_RESPONSE = "ProvinceName 1  其他";
test_class.modifier: private static final
test_class.original_string: private static final String EMPTY_PROVINCE_RESPONSE = "ProvinceName 1  其他";
test_class.type: String
test_class.var_name: EMPTY_PROVINCE_RESPONSE
test_class.declarator: INVALID_CITY_RESPONSE = "ProvinceName 0  其他";
test_class.modifier: private static final
test_class.original_string: private static final String INVALID_CITY_RESPONSE = "ProvinceName 0  其他";
test_class.type: String
test_class.var_name: INVALID_CITY_RESPONSE
test_class.declarator: INVALID_RESPONSE = "其他地区  其他";
test_class.modifier: private static final
test_class.original_string: private static final String INVALID_RESPONSE = "其他地区  其他";
test_class.type: String
test_class.var_name: INVALID_RESPONSE
test_class.file: app/src/test/java/com/brucetoo/pickview/provincepick/utils/ProvinceInfoUtilsTest.java
test_class.identifier: ProvinceInfoUtilsTest
test_class.superclass: extends PickViewTestSupport
test_case.body: @Test
      public void testMatchAddress() throws IOException {
          // when
          Context contextMock = Mockito.mock(Context.class);
          String validProvinceId = PROVINCE_ID + "-0";
          String emptyProvinceId = PROVINCE_ID + "-1";
          String validCityId = CITY_ID + "-0";
  
          ArrayList<ProvinceModel> provinces = createProvinces();
          provinces.add(null);
  
          CityModel[] cities = createCities();
  
          ProvinceModel provinceModel = provinces.get(0);
          provinceModel.addCity(null);
          for (CityModel city : cities) {
              provinceModel.addCity(city);
          }
  
  
          // then
          assertEquals(
                  VALID_RESPONSE,
                  ProvinceInfoUtils.matchAddress(contextMock, validProvinceId, validCityId, provinces));
  
          assertEquals(
                  EMPTY_PROVINCE_RESPONSE,
                  ProvinceInfoUtils.matchAddress(contextMock, emptyProvinceId, validCityId, provinces));
  
          assertEquals(
                  INVALID_RESPONSE,
                  ProvinceInfoUtils.matchAddress(contextMock, PROVINCE_ID, validCityId, provinces));
  
          assertEquals(
                  INVALID_CITY_RESPONSE,
                  ProvinceInfoUtils.matchAddress(contextMock, validProvinceId, CITY_ID, provinces));
  
          assertEquals(
                  INVALID_RESPONSE,
                  ProvinceInfoUtils.matchAddress(contextMock, validProvinceId, validCityId, new ArrayList<ProvinceModel>()));
  
          assertEquals(
                  INVALID_RESPONSE,
                  ProvinceInfoUtils.matchAddress(contextMock, null, validCityId, provinces));
  
          assertEquals(
                  INVALID_CITY_RESPONSE,
                  ProvinceInfoUtils.matchAddress(contextMock, validProvinceId, null, provinces));
  
          assertEquals(
                  INVALID_RESPONSE,
                  ProvinceInfoUtils.matchAddress(contextMock, validProvinceId, validCityId, null));
  
          assertEquals(
                  INVALID_RESPONSE,
                  ProvinceInfoUtils.matchAddress(contextMock, null, null, provinces));
  
          assertEquals(
                  INVALID_RESPONSE,
                  ProvinceInfoUtils.matchAddress(contextMock, null, null, null));
      }
test_case.class_method_signature: ProvinceInfoUtilsTest.testMatchAddress()
test_case.full_signature: @Test public void testMatchAddress()
test_case.identifier: testMatchAddress
test_case.invocations: mock createProvinces add createCities get addCity addCity assertEquals matchAddress assertEquals matchAddress assertEquals matchAddress assertEquals matchAddress assertEquals matchAddress assertEquals matchAddress assertEquals matchAddress assertEquals matchAddress assertEquals matchAddress assertEquals matchAddress
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testMatchAddress()
focal_class.file: app/src/main/java/com/brucetoo/pickview/provincepick/utils/ProvinceInfoUtils.java
focal_class.identifier: ProvinceInfoUtils
focal_class.class_method_signature: ProvinceInfoUtils.matchAddress(Context cxt, String provinceId, String cityId, ArrayList<ProvinceModel> provinceList)
focal_class.full_signature: public static String matchAddress(Context cxt, String provinceId, String cityId, ArrayList<ProvinceModel> provinceList)
focal_class.identifier: matchAddress
focal_class.modifiers: public static
focal_class.parameters: (Context cxt, String provinceId, String cityId, ArrayList<ProvinceModel> provinceList)
focal_class.return: String
focal_class.signature: String matchAddress(Context cxt, String provinceId, String cityId, ArrayList<ProvinceModel> provinceList)
focal_method.body: public static String matchAddress(Context cxt, String provinceId, String cityId, ArrayList<ProvinceModel> provinceList) {
  
  		int count = (null == provinceList) ? 0 : provinceList.size();
  		Resources res = cxt.getResources();
  		String province = "其他地区";
  		String city = "其他";
  		StringBuffer sb = new StringBuffer();
  		ProvinceModel provinceModel = null;
  
  		for (int i = 0; i < count; i++) {
  
  			provinceModel = provinceList.get(i);
  
  			if (null != provinceModel && provinceModel.id.equals(provinceId)) {
  
  				int cityCount;
  				CityModel cityModel = null;
  
  				province = provinceModel.name;
  				cityCount = provinceModel.getCityCount();
  
  				for (int j = 0; j < cityCount; j++) {
  
  					cityModel = provinceModel.getCity(j);
  
  					if (null != cityModel && cityModel.id.equals(cityId)) {
  
  						city = cityModel.name;
  						break;
  					}
  				}
  				break;
  			}
  		}
  
  		sb.append(province);
  		sb.append("  ");
  		sb.append(city);
  
  		return sb.toString();
  	}
focal_method.class_method_signature: ProvinceInfoUtils.matchAddress(Context cxt, String provinceId, String cityId, ArrayList<ProvinceModel> provinceList)
focal_method.full_signature: public static String matchAddress(Context cxt, String provinceId, String cityId, ArrayList<ProvinceModel> provinceList)
focal_method.identifier: matchAddress
focal_method.invocations: size getResources get equals getCityCount getCity equals append append append toString
focal_method.modifiers: public static
focal_method.parameters: (Context cxt, String provinceId, String cityId, ArrayList<ProvinceModel> provinceList)
focal_method.return: String
focal_method.signature: String matchAddress(Context cxt, String provinceId, String cityId, ArrayList<ProvinceModel> provinceList)