Merge branch 'typescript' of https://codefirst.iut.uca.fr/git/BOB_PARTEAM/BOB_PARTY into typescript
commit
c4041b1023
@ -1,57 +1,69 @@
|
||||
import { randomBytes } from "crypto";
|
||||
import { ImageSourcePropType } from "react-native";
|
||||
|
||||
export class Game{
|
||||
private Name:string;
|
||||
private ImageSource:ImageSourcePropType;
|
||||
private GameSource:string;
|
||||
private NbPlayer: number;
|
||||
export abstract class Game{
|
||||
private name:string;
|
||||
private imageSource:ImageSourcePropType;
|
||||
private gameSource:string;
|
||||
private nbPlayerMin: number;
|
||||
private nbPlayerMax:number;
|
||||
|
||||
/* Constructor of the class */
|
||||
constructor (name:string, imageSource:ImageSourcePropType, gameSource:string, nbPlayer:number){
|
||||
this.Name=name;
|
||||
this.ImageSource=imageSource;
|
||||
this.GameSource=gameSource;
|
||||
this.NbPlayer=nbPlayer;
|
||||
constructor (name:string, imageSource:ImageSourcePropType, gameSource:string, nbPlayerMin:number, nbPlayerMax:number){
|
||||
this.name=name;
|
||||
this.imageSource=imageSource;
|
||||
this.gameSource=gameSource;
|
||||
this.nbPlayerMin=nbPlayerMin;
|
||||
this.nbPlayerMax=nbPlayerMax;
|
||||
}
|
||||
|
||||
/* Brief : Function getting the name of a game */
|
||||
getName(){
|
||||
return this.Name;
|
||||
return this.name;
|
||||
}
|
||||
|
||||
/* Brief : Function setting the name of a game */
|
||||
setName(name:string){
|
||||
this.Name=name;
|
||||
this.name=name;
|
||||
}
|
||||
|
||||
/* Brief : Function getting the image of a game */
|
||||
getImageSource(){
|
||||
return this.ImageSource;
|
||||
return this.imageSource;
|
||||
}
|
||||
|
||||
/* Brief : Function setting the image of a game */
|
||||
setImageSource(imageSource:ImageSourcePropType){
|
||||
this.ImageSource=imageSource;
|
||||
this.imageSource=imageSource;
|
||||
}
|
||||
|
||||
/* Brief : Function getting the source of a game */
|
||||
getGameSource(){
|
||||
return this.GameSource;
|
||||
return this.gameSource;
|
||||
}
|
||||
|
||||
/* Brief : Function setting the source of a game */
|
||||
setGameSource(gameSource:string){
|
||||
this.GameSource=gameSource;
|
||||
this.gameSource=gameSource;
|
||||
}
|
||||
|
||||
/* Brief : Function getting the number of player */
|
||||
getNbPlayer(){
|
||||
return this.NbPlayer;
|
||||
getNbPlayerMin(){
|
||||
return this.nbPlayerMin;
|
||||
}
|
||||
|
||||
/* Brief : Function setting the number of player*/
|
||||
setNbPlayer(nbPlayer:number){
|
||||
this.NbPlayer=nbPlayer;
|
||||
setNbPlayerMin(nbPlayerMin:number){
|
||||
this.nbPlayerMin=nbPlayerMin;
|
||||
}
|
||||
|
||||
/* Brief : Function getting the number of player */
|
||||
getNbPlayerMax(){
|
||||
return this.nbPlayerMax;
|
||||
}
|
||||
|
||||
/* Brief : Function setting the number of player*/
|
||||
setNbPlayerMax(nbPlayerMax:number){
|
||||
this.nbPlayerMax=nbPlayerMax;
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
import { User } from "./user";
|
||||
import { Skin } from "../Skin";
|
||||
import { ManagerCoinsUser } from "./managerCoinsUser";
|
||||
//import ManagerCoinsUser
|
||||
|
||||
|
||||
export class SkinBuyer{
|
||||
buy(u:User, s:Skin){
|
||||
const manage=new ManagerCoinsUser();
|
||||
u.getTabSkin().push(s);
|
||||
manage.removeCoins(u, s.getSkinCost());
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
import { User } from "./user";
|
||||
|
||||
export class ManagerCoinsUser{
|
||||
addCoins(u:User, coins:number){
|
||||
u.setCurrentCoins(u.getCurrentCoins()+coins);
|
||||
u.setTotalCoins(u.getTotalCoins()+coins);
|
||||
}
|
||||
|
||||
removeCoins(u:User, coins:number){
|
||||
u.setCurrentCoins(u.getCurrentCoins()-coins);
|
||||
}
|
||||
|
||||
changeCurrentCoins(u:User, coins:number){
|
||||
u.setCurrentCoins(coins);
|
||||
}
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
import { Conversation } from './Conversation';
|
||||
import { Message } from './Message';
|
||||
import { User } from './User';
|
||||
|
||||
|
||||
// Instance
|
||||
|
||||
|
||||
|
||||
// Tests des get
|
||||
describe('Message get tests', () => {
|
||||
it('should return Bob Party est le meilleur projet', () => {
|
||||
expect(mess.getMessageContent()).toBe('Bob Party est le meilleur projet');
|
||||
})
|
||||
it('should return usr', () => {
|
||||
expect(mess.getMessageSender()).toBe(usr);
|
||||
})
|
||||
it('should return wouhou', () => {
|
||||
expect(mess.getMessageDate()).toBe(theDate);
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
// Set de nouvelles valeurs
|
||||
mess.setMessageContent('Vive Bob Party');
|
||||
mess.setSMessageSender(usr2);
|
||||
mess.setSMessageDate(theDate2);
|
||||
|
||||
|
||||
// Tests de set
|
||||
describe('Message set tests', () => {
|
||||
it('should return Vive Bob Party', () => {
|
||||
expect(mess.getMessageContent()).toBe('Vive Bob Party');
|
||||
})
|
||||
it('should return usr2', () => {
|
||||
expect(mess.getMessageSender()).toBe(usr2);
|
||||
})
|
||||
it('should return theDate2', () => {
|
||||
expect(mess.getMessageDate()).toBe(theDate2);
|
||||
})
|
||||
})
|
@ -0,0 +1,11 @@
|
||||
import { Match } from "./match";
|
||||
import { User } from "./User/user";
|
||||
import { Game } from "./game";
|
||||
import { GameCasino } from "./gameCasino";
|
||||
|
||||
export class MatchMulti extends Match{
|
||||
|
||||
constructor(code:string, tabUser:User[], game:GameCasino){
|
||||
super(code, tabUser, game);
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
import { Match } from "./match";
|
||||
import { User } from "./User/user";
|
||||
import { Game } from "./game";
|
||||
import { GameMulti } from "./gameMulti";
|
||||
|
||||
export class MatchMulti extends Match{
|
||||
|
||||
constructor(code:string, tabUser:User[], game:GameMulti){
|
||||
super(code, tabUser, game);
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
import { Match } from "./match";
|
||||
import { GameSolo } from "./gameSolo";
|
||||
import { User } from "./User/user";
|
||||
import { Game } from "./game";
|
||||
|
||||
export class MatchSolo extends Match{
|
||||
|
||||
constructor(code:string, tabUser:User[], game:GameSolo){
|
||||
super(code, tabUser, game);
|
||||
}
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
import { Skin } from './Skin';
|
||||
|
||||
/*
|
||||
// Instance
|
||||
|
||||
|
||||
let classique = new Skin('Classique', 'wouhou');
|
||||
|
||||
|
||||
// Tests des get
|
||||
describe('Skin get tests', () => {
|
||||
it('should return Classique', () => {
|
||||
expect(classique.getSkinName()).toBe('Classique');
|
||||
})
|
||||
it('should return wouhou', () => {
|
||||
expect(classique.getSkinSource()).toBe('wouhou');
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
// Set de nouvelles valeurs
|
||||
classique.setSkinName('The Classique');
|
||||
classique.setSkinSource('The wouhou');
|
||||
|
||||
|
||||
// Tests de set
|
||||
describe('Skin set tests', () => {
|
||||
it('should return The Classique', () => {
|
||||
expect(classique.getSkinName()).toBe('The Classique');
|
||||
})
|
||||
it('should return The wouhou', () => {
|
||||
expect(classique.getSkinSource()).toBe('The wouhou');
|
||||
})
|
||||
})*/
|
@ -1,51 +1,51 @@
|
||||
import { ImageSourcePropType } from "react-native";
|
||||
|
||||
export class Skin{
|
||||
readonly Id: string;
|
||||
private Name: string;
|
||||
private Source: ImageSourcePropType;
|
||||
private Cost:number;
|
||||
readonly id: string;
|
||||
private name: string;
|
||||
private source: ImageSourcePropType;
|
||||
private cost:number;
|
||||
|
||||
/* Constructor of the class */
|
||||
constructor(id:string, name: string, source:ImageSourcePropType, Cost:number){
|
||||
this.Id=id;
|
||||
this.Name=name;
|
||||
this.Source=source;
|
||||
this.Cost=Cost;
|
||||
this.id=id;
|
||||
this.name=name;
|
||||
this.source=source;
|
||||
this.cost=Cost;
|
||||
}
|
||||
|
||||
/* Brief : Fuction setting the name of a skin */
|
||||
setSkinName(name: string){
|
||||
this.Name=name;
|
||||
this.name=name;
|
||||
}
|
||||
|
||||
/* Brief : Fuction setting the source of the image of a skin */
|
||||
setSkinSource(source: ImageSourcePropType){
|
||||
this.Source=source;
|
||||
this.source=source;
|
||||
}
|
||||
|
||||
/* Brief : Fuction getting the source of the image of a skin */
|
||||
getSkinSource(){
|
||||
return this.Source;
|
||||
return this.source;
|
||||
}
|
||||
|
||||
/* Brief : Fuction getting the name of a skin */
|
||||
getSkinName(){
|
||||
return this.Name;
|
||||
return this.name;
|
||||
}
|
||||
|
||||
/* Brief : Fuction getting the id of a skin */
|
||||
getSkinId(){
|
||||
return this.Id;
|
||||
return this.id;
|
||||
}
|
||||
|
||||
/* Brief : Fuction getting the cost of a skin */
|
||||
getSkinCost(){
|
||||
return this.Cost;
|
||||
return this.cost;
|
||||
}
|
||||
|
||||
/* Brief : Fuction getting the cost of a skin */
|
||||
setSkinCost(cost:number){
|
||||
this.Cost=cost;
|
||||
this.cost=cost;
|
||||
}
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
import { Conversation } from '../Conversation';
|
||||
import { Message } from '../Message';
|
||||
import { Skin } from '../Skin';
|
||||
import { User } from '../User/user';
|
||||
|
||||
|
||||
// Instances
|
||||
let conv:Conversation[] = [];
|
||||
let tab:Skin[] = [];
|
||||
let classique = new Skin("S0001", "Bob", require('bob_party/assets/BobsSkins/BobClassic.png'), 0);
|
||||
let dateBirth = new Date(2010,0o3,0o7);
|
||||
let usr = new User('00001', 'Killyan', 'password', 'France', 'M', dateBirth, 0, 0, 0, classique, tab, conv);
|
||||
let usr2 = new User('00002', 'Karina', '1234', 'France', 'F', dateBirth, 5, 6, 8, classique, tab, conv);
|
||||
let theDate = new Date(2022,10,14);
|
||||
let theDate2 = new Date(2022,10,13);
|
||||
let theDate3 = new Date(2022,10,15);
|
||||
let mess = new Message('Bob Party est le meilleur projet', usr, theDate2);
|
||||
let tabU:User[] = [usr, usr2];
|
||||
let mess2 = new Message('Oui tout à fait', usr2, theDate);
|
||||
let mess3 = new Message('Mais oui trop de ouf', usr, theDate3);
|
||||
let tabM:Message[] = [mess, mess2];
|
||||
let convo = new Conversation(tabU, tabM, 'the conv');
|
||||
let usr3 = new User('00003', 'wow', 'password', 'France', 'M', dateBirth, 0, 0, 0, classique, tab, conv);
|
||||
|
||||
|
||||
// Get tests
|
||||
describe('Conversation get tests', () => {
|
||||
it('should return tabU [usr, usr2] (users)', () => {
|
||||
expect(convo.getTabUser()).toBe(tabU);
|
||||
})
|
||||
it('should return tabM [mess, mess2] (messages)', () => {
|
||||
expect(convo.getTabMessage()).toBe(tabM);
|
||||
})
|
||||
it('should return the conv', () => {
|
||||
expect(convo.getName()).toBe('the conv');
|
||||
})
|
||||
it('should return Oui tout à fait (mess2)', () => {
|
||||
expect(convo.getLastMessage()).toBe('Oui tout à fait');
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
// Setting new value
|
||||
convo.setName('THE conv');
|
||||
|
||||
|
||||
// Set test
|
||||
describe('Conversation set test', () => {
|
||||
it('should return THE conv', () => {
|
||||
expect(convo.setName).toBe('THE conv');
|
||||
})
|
||||
})
|
@ -0,0 +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,62 @@
|
||||
import { GameMulti } from '../gameMulti';
|
||||
|
||||
|
||||
// Instances
|
||||
let myMap = new Map<number, number>([
|
||||
[50, 3],
|
||||
[75, 4],
|
||||
[100, 5],
|
||||
[150, 6]
|
||||
]);
|
||||
let game = new GameMulti("bo jeu", require('bob_party/assets/ImagesJeux/blackjack.jpg'), "super jeu", 1, 5, myMap);
|
||||
|
||||
|
||||
// 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);
|
||||
})
|
||||
it('should return myMap', () => {
|
||||
expect(game.getMultiMap()).toBe(myMap);
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
// 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('GameMulti 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,62 @@
|
||||
import { GameSolo } from '../GameSolo';
|
||||
|
||||
|
||||
// Instances
|
||||
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);
|
||||
|
||||
|
||||
// Get tests
|
||||
describe('GameSolo 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 1', () => {
|
||||
expect(game.getNbPlayerMax()).toBe(1);
|
||||
})
|
||||
it('should return myMap', () => {
|
||||
expect(game.getSoloMap()).toBe(myMap);
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
// 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(3);
|
||||
|
||||
|
||||
// Set tests
|
||||
describe('GameSolo 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 2', () => {
|
||||
expect(game.getNbPlayerMin()).toBe(2);
|
||||
})
|
||||
it('should return 3', () => {
|
||||
expect(game.getNbPlayerMax()).toBe(3);
|
||||
})
|
||||
})
|
@ -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);
|
||||
})
|
||||
})
|
@ -0,0 +1,50 @@
|
||||
import { Skin } from '../Skin';
|
||||
|
||||
|
||||
|
||||
// Instance
|
||||
|
||||
let classique = new Skin("S0001", "Bob", require('bob_party/assets/BobsSkins/BobClassic.png'), 0);
|
||||
|
||||
|
||||
|
||||
// Get tests
|
||||
|
||||
describe('Skin get tests', () => {
|
||||
it('should return S0001', () => {
|
||||
expect(classique.getSkinId()).toBe('S0001');
|
||||
})
|
||||
it('should return Bob', () => {
|
||||
expect(classique.getSkinName()).toBe('Bob');
|
||||
})
|
||||
it('should return require(BobClassic.png)', () => {
|
||||
expect(classique.getSkinSource()).toBe(require('bob_party/assets/BobsSkins/BobClassic.png'));
|
||||
})
|
||||
it('should return 0', () => {
|
||||
expect(classique.getSkinCost()).toBe(0);
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
|
||||
// Setting new values
|
||||
|
||||
classique.setSkinName('Bob Blue');
|
||||
classique.setSkinCost(100);
|
||||
classique.setSkinSource(require('bob_party/assets/BobsSkins/BobBlue.png'));
|
||||
|
||||
|
||||
|
||||
// Set tests
|
||||
|
||||
describe('Skin set tests', () => {
|
||||
it('should return The Classique', () => {
|
||||
expect(classique.getSkinName()).toBe('Bob blue');
|
||||
})
|
||||
it('should return require(BobBlue.png)', () => {
|
||||
expect(classique.getSkinSource()).toBe(require('bob_party/assets/BobsSkins/BobBlue.png'));
|
||||
})
|
||||
it('should return 100', () => {
|
||||
expect(classique.getSkinCost()).toBe(0);
|
||||
})
|
||||
})
|
Loading…
Reference in new issue