|
1 | 1 | var id = 'test-app';
|
2 | 2 |
|
3 | 3 | test('Test Update update(0) returns 0 (current state)', function(assert) {
|
4 |
| - var result = update(0); |
| 4 | + var result = update('unrecognised', 0); |
5 | 5 | assert.equal(result, 0);
|
6 | 6 | });
|
7 | 7 |
|
8 | 8 | test('Test Update increment: update(1, "inc") returns 2', function(assert) {
|
9 |
| - var result = update(1, "inc"); |
| 9 | + var result = update("inc", 1,); |
10 | 10 | assert.equal(result, 2);
|
11 | 11 | });
|
12 | 12 |
|
13 |
| -test('Test Update decrement: update(3, "dec") returns 2', function(assert) { |
14 |
| - var result = update(1, "dec"); |
15 |
| - assert.equal(result, 0); |
| 13 | +test('Test Update decrement: update("dec", 3) returns 2', function(assert) { |
| 14 | + var result = update("dec", 3); |
| 15 | + assert.equal(result, 2); |
16 | 16 | });
|
17 | 17 |
|
18 |
| -test('Test negative state: update(-9, "inc") returns -8', function(assert) { |
19 |
| - var result = update(-9, "inc"); |
| 18 | +test('Test negative state: update("inc", -9) returns -8', function(assert) { |
| 19 | + var result = update("inc", -9, ); |
20 | 20 | assert.equal(result, -8);
|
21 | 21 | });
|
22 | 22 |
|
@@ -50,7 +50,7 @@ function(assert) {
|
50 | 50 | // Reset Functionality
|
51 | 51 |
|
52 | 52 | test('Test reset counter when model/state is 6 returns 0', function(assert) {
|
53 |
| - var result = update(6, "reset"); |
| 53 | + var result = update("reset", 6); |
54 | 54 | assert.equal(result, 0);
|
55 | 55 | });
|
56 | 56 |
|
|
0 commit comments