/**
  * @covers \Magento\Quote\Model\ShippingMethodManagement::estimateByExtendedAddress
  */
 public function testEstimateByExtendedAddress()
 {
     $cartId = 1;
     $addressData = ['region' => 'California', 'region_id' => 23, 'country_id' => 1, 'postcode' => 90200];
     $currencyCode = 'UAH';
     $address = $this->getMockBuilder(Address::class)->disableOriginalConstructor()->setMethods(['getData'])->getMock();
     $this->quoteRepository->expects(static::once())->method('getActive')->with($cartId)->willReturn($this->quote);
     $this->quote->expects(static::once())->method('isVirtual')->willReturn(false);
     $this->quote->expects(static::once())->method('getItemsCount')->willReturn(1);
     $address->expects(static::once())->method('getData')->willReturn($addressData);
     $this->quote->expects(static::once())->method('getShippingAddress')->willReturn($this->shippingAddress);
     $this->shippingAddress->expects(static::once())->method('addData')->with($addressData)->willReturnSelf();
     $this->shippingAddress->expects(static::once())->method('setCollectShippingRates')->with(true)->willReturnSelf();
     $this->totalsCollector->expects(static::once())->method('collectAddressTotals')->with($this->quote, $this->shippingAddress)->willReturnSelf();
     $rate = $this->getMockBuilder(Rate::class)->disableOriginalConstructor()->setMethods([])->getMock();
     $methodObject = $this->getMockForAbstractClass(ShippingMethodInterface::class);
     $expectedRates = [$methodObject];
     $this->shippingAddress->expects(static::once())->method('getGroupedAllShippingRates')->willReturn([[$rate]]);
     $this->quote->expects(static::once())->method('getQuoteCurrencyCode')->willReturn($currencyCode);
     $this->converter->expects(static::once())->method('modelToDataObject')->with($rate, $currencyCode)->willReturn($methodObject);
     $carriersRates = $this->model->estimateByExtendedAddress($cartId, $address);
     static::assertEquals($expectedRates, $carriersRates);
 }