corrections sur les tests

peristanceBDD
Mathilde JEAN 2 years ago
parent 4684f45b59
commit 709f1ab48a

@ -15,9 +15,6 @@ describe('GameMuti get tests', () => {
it('should return img ("")', () => { it('should return img ("")', () => {
expect(game.getImageSource()).toBe(img); expect(game.getImageSource()).toBe(img);
}) })
it('should return super jeu', () => {
expect(game.getGameSource()).toBe('super jeu');
})
it('should return 1', () => { it('should return 1', () => {
expect(game.getNbPlayerMin()).toBe(1); expect(game.getNbPlayerMin()).toBe(1);
}) })
@ -37,10 +34,6 @@ describe('GameCasino set tests', () => {
game.setImageSource(img); game.setImageSource(img);
expect(game.getImageSource()).toBe(img); expect(game.getImageSource()).toBe(img);
}) })
it('should return trop cool le jeu', () => {
game.setGameSource('trop cool le jeu');
expect(game.getGameSource()).toBe('trop cool le jeu');
})
it('should return trop cool le jeu', () => { it('should return trop cool le jeu', () => {
game.setNbPlayerMin(2); game.setNbPlayerMin(2);
expect(game.getNbPlayerMin()).toBe(2); expect(game.getNbPlayerMin()).toBe(2);

@ -23,9 +23,6 @@ describe('GameMulti get tests', () => {
it('should return require(blackjack.jpg)', () => { it('should return require(blackjack.jpg)', () => {
expect(game.getImageSource()).toEqual(img); expect(game.getImageSource()).toEqual(img);
}) })
it('should return super jeu', () => {
expect(game.getGameSource()).toBe('super jeu');
})
it('should return 1', () => { it('should return 1', () => {
expect(game.getNbPlayerMin()).toBe(1); expect(game.getNbPlayerMin()).toBe(1);
}) })
@ -48,10 +45,6 @@ describe('GameMulti set tests', () => {
game.setImageSource(img); game.setImageSource(img);
expect(game.getImageSource()).toEqual(img); expect(game.getImageSource()).toEqual(img);
}) })
it('should return trop cool le jeu', () => {
game.setGameSource('trop cool le jeu');
expect(game.getGameSource()).toBe('trop cool le jeu');
})
it('should return trop cool le jeu', () => { it('should return trop cool le jeu', () => {
game.setNbPlayerMin(2); game.setNbPlayerMin(2);
expect(game.getNbPlayerMin()).toBe(2); expect(game.getNbPlayerMin()).toBe(2);

@ -22,9 +22,6 @@ describe('GameSolo get tests', () => {
it('should return blackjack.jpg', () => { it('should return blackjack.jpg', () => {
expect(game.getImageSource()).toEqual(img); expect(game.getImageSource()).toEqual(img);
}) })
it('should return super jeu', () => {
expect(game.getGameSource()).toBe('super jeu');
})
it('should return 1', () => { it('should return 1', () => {
expect(game.getNbPlayerMin()).toBe(1); expect(game.getNbPlayerMin()).toBe(1);
}) })
@ -47,10 +44,6 @@ describe('GameSolo set tests', () => {
game.setImageSource(img); game.setImageSource(img);
expect(game.getImageSource()).toEqual(img); expect(game.getImageSource()).toEqual(img);
}) })
it('should return trop cool le jeu', () => {
game.setGameSource('trop cool le jeu');
expect(game.getGameSource()).toBe('trop cool le jeu');
})
it('should return 2', () => { it('should return 2', () => {
game.setNbPlayerMin(2); game.setNbPlayerMin(2);
expect(game.getNbPlayerMin()).toBe(2); expect(game.getNbPlayerMin()).toBe(2);
@ -64,16 +57,16 @@ describe('GameSolo set tests', () => {
// Coins Calculator tests // Coins Calculator tests
describe('GameSolo coins calculator tests', () => { describe('GameSolo coins calculator tests', () => {
it('should return 50', () => { it('should return 3', () => {
expect(game.coinsCalculator(3)).toBe(50); expect(game.coinsCalculator(3)).toBe(3);
}) })
it('should return 75', () => { it('should return 4', () => {
expect(game.coinsCalculator(4)).toBe(75); expect(game.coinsCalculator(4)).toBe(4);
}) })
it('should return 100', () => { it('should return 5', () => {
expect(game.coinsCalculator(5)).toBe(100); expect(game.coinsCalculator(5)).toBe(5);
}) })
it('should return 150', () => { it('should return 6', () => {
expect(game.coinsCalculator(6)).toBe(150); expect(game.coinsCalculator(6)).toBe(6);
}) })
}) })

@ -64,20 +64,20 @@ describe('Match set tests', () => {
// Update Post-Match tests // Update Post-Match tests
describe('Update post-match tests', () => { describe('Update post-match tests', () => {
it('should return 50', () => { it('should return 3', () => {
match.updatePostMatch(tabU[0],3); match.updatePostMatch(tabU[0],3);
expect(tabU[0].getCurrentCoins()).toBe(50); expect(tabU[0].getCurrentCoins()).toBe(3);
}) })
it('should return 75', () => { it('should return 4', () => {
match.updatePostMatch(usr2,4); match.updatePostMatch(usr2,4);
expect(usr2.getCurrentCoins()).toBe(75); expect(usr2.getCurrentCoins()).toBe(4);
}) })
it('should return 150', () => { it('should return 8', () => {
match.updatePostMatch(tabU[0],5); match.updatePostMatch(tabU[0],5);
expect(tabU[0].getCurrentCoins()).toBe(150); expect(tabU[0].getCurrentCoins()).toBe(8);
}) })
it('should return 225', () => { it('should return 10', () => {
match.updatePostMatch(usr2,6); match.updatePostMatch(usr2,6);
expect(usr2.getCurrentCoins()).toBe(225); expect(usr2.getCurrentCoins()).toBe(10);
}) })
}) })

@ -20,7 +20,7 @@ export default class LoaderGameApi implements ILoaderGame{
}) })
.then(function (response: any) { .then(function (response: any) {
if (response.data != null && response.data != undefined){ if (response.data != null && response.data != undefined){
response.data.forEach(game => { response.data.forEach((game: { type: any; keys: string | any[]; values: any[]; id: number; name: string; image: string; nbPlayerMin: number; nbPlayerMax: number; }) => {
switch(game.type){ switch(game.type){
case "GameSolo": case "GameSolo":
let mapSolo = new Map(); let mapSolo = new Map();

Loading…
Cancel
Save