|
|
@ -11,8 +11,8 @@ let classique = new Skin("S0001", "Bob", require('bob_party/assets/BobsSkins/Bob
|
|
|
|
let blue = new Skin("S0002", "Bob Blue", require('bob_party/assets/BobsSkins/BobBlue.png'), 100);
|
|
|
|
let blue = new Skin("S0002", "Bob Blue", require('bob_party/assets/BobsSkins/BobBlue.png'), 100);
|
|
|
|
let tab:Skin[] = [classique, blue];
|
|
|
|
let tab:Skin[] = [classique, blue];
|
|
|
|
let dateBirth = new Date(2010,0o3,0o7);
|
|
|
|
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);
|
|
|
|
let usr = new User('00001', 'Killyan', 'password', 'France', 'M', dateBirth, 0, 0, 0, classique, tab);
|
|
|
|
|
|
|
|
let usr2 = new User('00002', 'Rémi', 'pwd', 'Martinique', 'M', dateBirth, 0, 0, 0, classique, tab);
|
|
|
|
let tabU:User[] = [usr];
|
|
|
|
let tabU:User[] = [usr];
|
|
|
|
let myMap = new Map<number, number>([
|
|
|
|
let myMap = new Map<number, number>([
|
|
|
|
[50, 3],
|
|
|
|
[50, 3],
|
|
|
@ -60,4 +60,25 @@ describe('Match set tests', () => {
|
|
|
|
it('should return game2', () => {
|
|
|
|
it('should return game2', () => {
|
|
|
|
expect(match.getGame).toBe(game2);
|
|
|
|
expect(match.getGame).toBe(game2);
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Update Post-Match tests
|
|
|
|
|
|
|
|
describe('Update post-match tests', () => {
|
|
|
|
|
|
|
|
it('should return 3', () => {
|
|
|
|
|
|
|
|
match.updatePostMatch(tabU[0],50);
|
|
|
|
|
|
|
|
expect(tabU[0].getCurrentCoins()).toBe(3);
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
it('should return 8', () => {
|
|
|
|
|
|
|
|
match.updatePostMatch(tabU[0],100);
|
|
|
|
|
|
|
|
expect(tabU[0].getCurrentCoins()).toBe(8);
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
it('should return 4', () => {
|
|
|
|
|
|
|
|
match.updatePostMatch(usr2,75);
|
|
|
|
|
|
|
|
expect(usr2.getCurrentCoins()).toBe(4);
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
it('should return 10', () => {
|
|
|
|
|
|
|
|
match.updatePostMatch(usr2,150);
|
|
|
|
|
|
|
|
expect(usr2.getCurrentCoins()).toBe(10);
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|