Skip to content

Commit

Permalink
Added test with nominational rate for Russian Central Bank
Browse files Browse the repository at this point in the history
  • Loading branch information
denlapaev committed Feb 15, 2018
1 parent f5abde2 commit 204fa12
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/Tests/Service/RussianCentralBankTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,21 @@ public function it_fetches_a_rate()
$this->assertEquals(new \DateTime('2016-12-09'), $rate->getDate());
}

/**
* @test
*/
public function it_fetches_a_nominational_rate()
{
$url = 'http://www.cbr.ru/scripts/XML_daily.asp';
$content = file_get_contents(__DIR__.'/../../Fixtures/Service/RussianCentralBank/success.xml');

$service = new RussianCentralBank($this->getHttpAdapterMock($url, $content));
$rate = $service->getExchangeRate(new ExchangeRateQuery(CurrencyPair::createFromString('AMD/RUB')));

$this->assertSame('0.131783', $rate->getValue());
$this->assertEquals(new \DateTime('2016-12-09'), $rate->getDate());
}

/**
* @test
*/
Expand Down

0 comments on commit 204fa12

Please sign in to comment.