|
| 1 | +import 'mocha'; |
| 2 | +import { expect } from 'chai'; |
| 3 | +import { minCoinChange } from '../../../../src/js/index'; |
| 4 | + |
| 5 | +describe('Dynamic Programming: Min Coin Change', () => { |
| 6 | + |
| 7 | + it('works with amount 0', () => { |
| 8 | + expect(minCoinChange([1, 2, 3], 0)).to.deep.equal([]); |
| 9 | + }); |
| 10 | + |
| 11 | + it('works with amount 1', () => { |
| 12 | + expect(minCoinChange([1, 2, 3], 1)).to.deep.equal([1]); |
| 13 | + }); |
| 14 | + |
| 15 | + it('works with amount 2', () => { |
| 16 | + expect(minCoinChange([1, 2, 3], 2)).to.deep.equal([2]); |
| 17 | + }); |
| 18 | + |
| 19 | + it('works with amount 3', () => { |
| 20 | + expect(minCoinChange([1, 2, 3], 3)).to.deep.equal([3]); |
| 21 | + }); |
| 22 | + |
| 23 | + it('works with amount 4', () => { |
| 24 | + expect(minCoinChange([1, 2, 3], 4)).to.deep.equal([1, 3]); |
| 25 | + }); |
| 26 | + |
| 27 | + it('works with amount 6', () => { |
| 28 | + expect(minCoinChange([1, 2, 3], 6)).to.deep.equal([3, 3]); |
| 29 | + }); |
| 30 | +}); |
0 commit comments