|
@ -4,7 +4,8 @@ PlayerBuilder, |
|
|
buildPlayerArray, |
|
|
buildPlayerArray, |
|
|
movePlayer, |
|
|
movePlayer, |
|
|
over100, |
|
|
over100, |
|
|
landedOn |
|
|
|
|
|
|
|
|
landedOn, |
|
|
|
|
|
resetNewOld |
|
|
} = require('../js/playerHandling'); |
|
|
} = require('../js/playerHandling'); |
|
|
|
|
|
|
|
|
let player = {"position": 1, "newPosition": 1, "won": false}; |
|
|
let player = {"position": 1, "newPosition": 1, "won": false}; |
|
@ -105,4 +106,24 @@ describe('tests testen', () => { |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
describe('testen, ob die neue Position die aktuelle Position ersetzt ', () => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it('mit einer Zufallszahl von 1 bis 100 zwanzigmal', ()=>{ |
|
|
|
|
|
for(let i = 0; i <= 20; i++) |
|
|
|
|
|
{ |
|
|
|
|
|
min = Math.ceil(1); |
|
|
|
|
|
max = Math.floor(100); |
|
|
|
|
|
let position = Math.floor(Math.random() * (max - min + 1) + min) |
|
|
|
|
|
|
|
|
|
|
|
let player = {"position": 1, "newPosition": position, "won": false} |
|
|
|
|
|
resetNewOld(player); |
|
|
|
|
|
expect(player).toEqual({"position": position, "newPosition": 0, "won": false}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
}) |
|
|
}) |