public function testUpdateInvoice()
{
$this->client->post('invoiceitems', null, array('customer' => $this->customerId, 'amount' => 350, 'currency' => 'usd'));
$request = $this->invoices->createInvoiceRequest($this->customerId);
$invoice = $this->invoices->createInvoice($request);
$updatedInvoice = $this->invoices->updateInvoice($invoice->getId(), null, true, 'Updated Description', array('updated' => 'metadata'), 0.2);
$this->assertInstanceOf(Invoices::INVOICE_RESPONSE_CLASS, $updatedInvoice);
$this->assertEquals(null, $updatedInvoice->getApplicationFee());
$this->assertEquals(true, $updatedInvoice->getClosed());
$this->assertEquals('Updated Description', $updatedInvoice->getDescription());
$this->assertEquals(array('updated' => 'metadata'), $updatedInvoice->getMetadata());
$this->assertEquals(0.2, $updatedInvoice->getTaxPercent());
}