parent
71b96e5d76
commit
1421df401b
@ -1,3 +1,53 @@
|
||||
import { GameCasino } from '../GameCasino';
|
||||
|
||||
|
||||
|
||||
// Instances
|
||||
let game = new GameCasino("bo jeu", require('bob_party/assets/ImagesJeux/blackjack.jpg'), "super jeu", 1, 5);
|
||||
|
||||
|
||||
// Get tests
|
||||
describe('GameMuti get tests', () => {
|
||||
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 5', () => {
|
||||
expect(game.getNbPlayerMax()).toBe(5);
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
// Setting new values
|
||||
game.setGameSource('trop cool le jeu');
|
||||
game.setImageSource(require('bob_party/assets/ImagesJeux/JeuDeDame.jpg'));
|
||||
game.setName('beau jeu');
|
||||
game.setNbPlayerMin(2);
|
||||
game.setNbPlayerMax(4);
|
||||
|
||||
|
||||
// Set tests
|
||||
describe('GameCasino set tests', () => {
|
||||
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 trop cool le jeu', () => {
|
||||
expect(game.getNbPlayerMin()).toBe(2);
|
||||
})
|
||||
it('should return 4', () => {
|
||||
expect(game.getNbPlayerMin()).toBe(4);
|
||||
})
|
@ -0,0 +1,3 @@
|
||||
import { Match } from '../Match';
|
||||
|
||||
|
@ -0,0 +1,56 @@
|
||||
import { MatchSolo } from '../MatchSolo';
|
||||
import { Conversation } from '../Conversation';
|
||||
import { Skin } from '../Skin';
|
||||
import { User } from '../User/user';
|
||||
import { GameSolo } from '../GameSolo';
|
||||
|
||||
|
||||
|
||||
// Instances
|
||||
let classique = new Skin("S0001", "Bob", require('bob_party/assets/BobsSkins/BobClassic.png'), 0);
|
||||
let blue = new Skin("S0002", "Bob Blue", require('bob_party/assets/BobsSkins/BobBlue.png'), 100);
|
||||
let tab:Skin[] = [classique, blue];
|
||||
let dateBirth = new Date(2010,0o3,0o7);
|
||||
let conv:Conversation[] = [];
|
||||
let usr = new User('00001', 'Killyan', 'password', 'France', 'M', dateBirth, 0, 0, 0, classique, tab, conv);
|
||||
let tabU:User[] = [usr];
|
||||
let myMap = new Map<number, number>([
|
||||
[50, 3],
|
||||
[75, 4],
|
||||
[100, 5],
|
||||
[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 tabU2:User[] = [];
|
||||
let game2 = new GameSolo("jeu magnifique", require('bob_party/assets/ImagesJeux/blackjack.jpg'), "wow jeu", 1, 1, myMap)
|
||||
|
||||
|
||||
// Get tests
|
||||
describe('Match get tests', () => {
|
||||
it('should return machin', () => {
|
||||
expect(match.getCode()).toBe('machin');
|
||||
})
|
||||
it('should return tabU [usr] (users)', () => {
|
||||
expect(match.getTabUsers()).toBe(tabU);
|
||||
})
|
||||
it('should return game', () => {
|
||||
expect(match.getGame).toBe(game);
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
// Setting new values
|
||||
match.setGame(game2);
|
||||
match.setTabUser(tabU2);
|
||||
|
||||
|
||||
// Set tests
|
||||
describe('Match set tests', () => {
|
||||
it('should return tabU2 [] (users)', () => {
|
||||
expect(match.getTabUsers()).toBe(tabU2);
|
||||
})
|
||||
it('should return game2', () => {
|
||||
expect(match.getGame).toBe(game2);
|
||||
})
|
||||
})
|
Loading…
Reference in new issue