get(\Magento\Framework\Registry::class) ->registry('_fixture/Magento_Tax_Model_Calculation_Rule'); $customerTaxClasses = $taxRule->getCustomerTaxClassIds(); $productTaxClasses = $taxRule->getProductTaxClassIds(); $taxRate = $objectManager->get(\Magento\Framework\Registry::class) ->registry('_fixture/Magento_Tax_Model_Calculation_Rate'); $data = new \Magento\Framework\DataObject(); $data->setData( [ 'tax_country_id' => 'US', 'taxregion_id' => '12', 'tax_postcode' => '5555', 'customer_class_id' => $customerTaxClasses[0], 'product_class_id' => $productTaxClasses[0], ] ); $taxCalculation = $objectManager->get(\Magento\Tax\Model\ResourceModel\Calculation::class); $this->assertEquals($taxRate->getRateIds(), $taxCalculation->getRate($data)); } }