Corrections
continuous-integration/drone/push Build is passing Details

temp
Mathilde JEAN 2 years ago
parent ce9c40f7b4
commit 395dde5fb6

@ -1,6 +1,6 @@
import { ImageSourcePropType } from 'react-native';
import { Game } from './game'
/*
export class GameSolo extends Game{
readonly ptsToCoins:Map<number,number>
@ -25,4 +25,4 @@ export class GameSolo extends Game{
}
return coins;
}
}
}*/

@ -0,0 +1,68 @@
import { Game } from '../Game';
import { GameSolo } from '../GameSolo';
// Instances
let myMap = new Map<number, number>([
[50, 3],
[75, 4],
[100, 5],
[150, 6]
]);
let game:Game = new GameSolo("id", "bo jeu", require('bob_party/assets/ImagesJeux/blackjack.jpg'), "super jeu", 1, 1, myMap);
// Get tests
describe('GameSolo get tests', () => {
it('should return id', () => {
expect(game.getId()).toBe('id');
})
it('should return bo jeu', () => {
expect(game.getName()).toBe('bo jeu');
})
it('should return require(blackjack.jpg)', () => {
expect(game.getImageSource()).toBe(require('bob_party/assets/ImagesJeux/blackjack.jpg'));
})
it('should return super jeu', () => {
expect(game.getGameSource()).toBe('super jeu');
})
it('should return 1', () => {
expect(game.getNbPlayerMin()).toBe(1);
})
it('should return 1', () => {
expect(game.getNbPlayerMax()).toBe(1);
})
})
// Setting new values
game.setId('newId');
game.setGameSource('trop cool le jeu');
game.setImageSource(require('bob_party/assets/ImagesJeux/JeuDeDame.jpg'));
game.setName('beau jeu');
game.setNbPlayerMin(2);
game.setNbPlayerMax(3);
// Set tests
describe('GameSolo set tests', () => {
it('should return newId', () => {
expect(game.getId()).toBe('newId');
})
it('should return beau jeu', () => {
expect(game.getName()).toBe('beau jeu');
})
it('should return require(JeuDeDame.jpg)', () => {
expect(game.getImageSource).toBe(require('bob_party/assets/ImagesJeux/JeuDeDame.jpg'));
})
it('should return trop cool le jeu', () => {
expect(game.getGameSource()).toBe('trop cool le jeu');
})
it('should return 2', () => {
expect(game.getNbPlayerMin()).toBe(2);
})
it('should return 3', () => {
expect(game.getNbPlayerMax()).toBe(3);
})
})

@ -1,3 +0,0 @@
import { Match } from '../Match';

@ -21,7 +21,7 @@ let myMap = new Map<number, number>([
[150, 6]
]);
let game=new GameSolo("bo jeu", require('bob_party/assets/ImagesJeux/blackjack.jpg'), "super jeu", 1, 1, myMap);
let match = new MatchSolo("machin", tabU, game);
let match = new MatchSolo("machin", false, tabU, game);
let tabU2:User[] = [];
let game2 = new GameSolo("jeu magnifique", require('bob_party/assets/ImagesJeux/blackjack.jpg'), "wow jeu", 1, 1, myMap)
@ -31,6 +31,9 @@ describe('Match get tests', () => {
it('should return machin', () => {
expect(match.getCode()).toBe('machin');
})
it('should return false', () => {
expect(match.getInGame()).toBe(false);
})
it('should return tabU [usr] (users)', () => {
expect(match.getTabUsers()).toBe(tabU);
})
@ -42,6 +45,7 @@ describe('Match get tests', () => {
// Setting new values
match.setGame(game2);
match.setInGame(true);
match.setTabUser(tabU2);
@ -50,6 +54,9 @@ describe('Match set tests', () => {
it('should return tabU2 [] (users)', () => {
expect(match.getTabUsers()).toBe(tabU2);
})
it('should return true', () => {
expect(match.getInGame()).toBe(true);
})
it('should return game2', () => {
expect(match.getGame).toBe(game2);
})

@ -23,7 +23,7 @@ describe('Message get tests', () => {
it('should return usr', () => {
expect(mess.getMessageSender()).toBe(usr);
})
it('should return wouhou', () => {
it('should return theDate', () => {
expect(mess.getMessageDate()).toBe(theDate);
})
})

Loading…
Cancel
Save