Skip to content

Commit

Permalink
Adiciona testes para a moeda Escudo
Browse files Browse the repository at this point in the history
  • Loading branch information
theuves committed Jan 17, 2019
1 parent 3c6991e commit 3f42724
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/write-currency/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ test('Deve escrever valores monetários por extenso', (t) => {
t.is(writeCurrency('BRL', 'br', '1000000'), 'um milhão de reais')
t.is(writeCurrency('BRL', 'br', '2000000', '50'), 'dois milhões de reais e cinquenta centavos')

// Testes com o REAL
// Testes com o EURO
t.is(writeCurrency('EUR', 'pt', '1'), 'um euro')
t.is(writeCurrency('EUR', 'pt', '2'), 'dois euros')
t.is(writeCurrency('EUR', 'br', '14', '50'), 'quatorze euros e cinquenta cêntimos')
Expand All @@ -29,6 +29,19 @@ test('Deve escrever valores monetários por extenso', (t) => {
t.is(writeCurrency('EUR', 'pt', undefined, '25'), 'vinte e cinco cêntimos')
t.is(writeCurrency('EUR', 'pt', '1000000'), 'um milhão de euros')
t.is(writeCurrency('EUR', 'pt', '2000000', '50'), 'dois milhões de euros e cinquenta cêntimos')

// Testes com o ESCUDO
t.is(writeCurrency('ECV', 'pt', '1'), 'um escudo')
t.is(writeCurrency('ECV', 'pt', '2'), 'dois escudos')
t.is(writeCurrency('ECV', 'br', '14', '50'), 'quatorze escudos e cinquenta cêntimos')
t.is(writeCurrency('ECV', 'pt', '14', '50'), 'catorze escudos e cinquenta cêntimos')
t.is(writeCurrency('ECV', 'pt', '1', '50'), 'um escudo e cinquenta cêntimos')
t.is(writeCurrency('ECV', 'pt', '2', '5'), 'dois escudos e cinco cêntimos')
t.is(writeCurrency('ECV', 'pt', '0', '1'), 'um cêntimo')
t.is(writeCurrency('ECV', 'pt', '0', '5'), 'cinco cêntimos')
t.is(writeCurrency('ECV', 'pt', undefined, '25'), 'vinte e cinco cêntimos')
t.is(writeCurrency('ECV', 'pt', '1000000'), 'um milhão de escudos')
t.is(writeCurrency('ECV', 'pt', '2000000', '50'), 'dois milhões de escudos e cinquenta cêntimos')
})

/**
Expand Down

0 comments on commit 3f42724

Please sign in to comment.