diff --git a/bob_party/src/core/tests/conversation.test.ts b/bob_party/src/core/tests/conversation.test.ts index 79046c6..a18d3f3 100644 --- a/bob_party/src/core/tests/conversation.test.ts +++ b/bob_party/src/core/tests/conversation.test.ts @@ -14,11 +14,11 @@ 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(1, 'Bob Party est le meilleur projet', usr, theDate2); -let tabU:User[] = [usr, usr2]; +let tabU = [usr, usr2]; let mess2 = new Message(2, 'Oui tout à fait', usr2, theDate); let mess3 = new Message(3, 'Mais oui trop de ouf', usr, theDate3); -let tabM:Message[] = [mess, mess2]; -let tabM2:Message[] = [mess, mess2, mess3]; +let tabM = [mess, mess2]; +let tabM2 = [mess, mess2, mess3]; let convo = new Conversation(1, tabU, tabM, 'the conv'); let usr3 = new User(4, 'wow', 'password', 'France', 'M', dateBirth, 0, 0, 0, classique, tab); @@ -43,7 +43,7 @@ describe('Conversation get tests', () => { }) -// Set test +// Set tests describe('Conversation set test', () => { it('should return THE conv', () => { convo.setName('THE conv'); diff --git a/bob_party/src/core/tests/gameCasino.test.ts b/bob_party/src/core/tests/gameCasino.test.ts index c5dba07..5e83ef0 100644 --- a/bob_party/src/core/tests/gameCasino.test.ts +++ b/bob_party/src/core/tests/gameCasino.test.ts @@ -12,7 +12,7 @@ describe('GameMuti get tests', () => { it('should return bo jeu', () => { expect(game.getName()).toBe('bo jeu'); }) - it('should return require(blackjack.jpg)', () => { + it('should return img ("")', () => { expect(game.getImageSource()).toBe(img); }) it('should return super jeu', () => { @@ -27,36 +27,33 @@ describe('GameMuti get tests', () => { }) -// Setting new values -game.setGameSource('trop cool le jeu'); -game.setImageSource(img); -game.setName('beau jeu'); -game.setNbPlayerMin(2); -game.setNbPlayerMax(4); - - // Set tests describe('GameCasino set tests', () => { it('should return beau jeu', () => { + game.setName('beau jeu'); expect(game.getName()).toBe('beau jeu'); }) it('should return require(JeuDeDame.jpg)', () => { - expect(game.getImageSource).toBe(img); + game.setImageSource(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', () => { + game.setNbPlayerMin(2); expect(game.getNbPlayerMin()).toBe(2); }) it('should return 4', () => { - expect(game.getNbPlayerMin()).toBe(4); + game.setNbPlayerMax(4); + expect(game.getNbPlayerMax()).toBe(4); }) }) // Coins Calculator Tests -describe('Coins calculator tests', () => { +describe('GameCasino coins calculator tests', () => { it('should return 200', () => { expect(game.coinsCalculator(200)).toBe(200); }) diff --git a/bob_party/src/core/tests/message.test.ts b/bob_party/src/core/tests/message.test.ts index 8f3b0f9..ede53c9 100644 --- a/bob_party/src/core/tests/message.test.ts +++ b/bob_party/src/core/tests/message.test.ts @@ -22,29 +22,26 @@ describe('Message get tests', () => { expect(mess.getMessageContent()).toBe('Bob Party est le meilleur projet'); }) it('should return usr', () => { - expect(mess.getMessageSender()).toBe(usr); + expect(mess.getMessageSender()).toEqual(usr); }) it('should return theDate', () => { - expect(mess.getMessageDate()).toBe(theDate); + expect(mess.getMessageDate()).toEqual(theDate); }) }) -// Setting new values -mess.setMessageContent('Vive Bob Party'); -mess.setMessageSender(usr2); -mess.setMessageDate(theDate2); - - // Set tests describe('Message set tests', () => { it('should return Vive Bob Party', () => { + mess.setMessageContent('Vive Bob Party'); expect(mess.getMessageContent()).toBe('Vive Bob Party'); }) it('should return usr2', () => { - expect(mess.getMessageSender()).toBe(usr2); + mess.setMessageSender(usr2); + expect(mess.getMessageSender()).toEqual(usr2); }) it('should return theDate2', () => { - expect(mess.getMessageDate()).toBe(theDate2); + mess.setMessageDate(theDate2); + expect(mess.getMessageDate()).toEqual(theDate2); }) }) \ No newline at end of file diff --git a/bob_party/src/core/tests/skin.test.ts b/bob_party/src/core/tests/skin.test.ts index af6d1dc..c56bbde 100644 --- a/bob_party/src/core/tests/skin.test.ts +++ b/bob_party/src/core/tests/skin.test.ts @@ -15,7 +15,7 @@ describe('Skin get tests', () => { expect(classique.getSkinId()).toBe(1); }) it('should return Bob', () => { - expect(classique.getSkinName()).toEqual('Bob'); + expect(classique.getSkinName()).toBe('Bob'); }) it('should return img ("")', () => { expect(classique.getSkinSource()).toEqual(img); @@ -27,24 +27,19 @@ describe('Skin get tests', () => { -// Setting new values - -classique.setSkinName('Bob Blue'); -classique.setSkinCost(100); -classique.setSkinSource(img); - - - // Set tests describe('Skin set tests', () => { it('should return The Classique', () => { - expect(classique.getSkinName()).toBe('Bob blue'); + classique.setSkinName('Bob Blue'); + expect(classique.getSkinName()).toBe('Bob Blue'); }) - it('should return require(BobBlue.png)', () => { - expect(classique.getSkinSource()).toBe(img); + it('should return yo', () => { + classique.setSkinSource("yo"); + expect(classique.getSkinSource()).toBe('yo'); }) it('should return 100', () => { - expect(classique.getSkinCost()).toBe(0); + classique.setSkinCost(100); + expect(classique.getSkinCost()).toBe(100); }) }) \ No newline at end of file diff --git a/bob_party/src/services/tests/loaderUserApi.test.ts b/bob_party/src/services/tests/loaderUserApi.test.ts index ef356d4..8b82af6 100644 --- a/bob_party/src/services/tests/loaderUserApi.test.ts +++ b/bob_party/src/services/tests/loaderUserApi.test.ts @@ -22,13 +22,6 @@ let convo:Conversation = new Conversation(1, tabUS, [], 'superConvo'); // Tests describe('LoaderUserApi tests', () => { - /* - describe('loadAllUser tests', () => { - it('should return tabUS [UserTest, Alban, UserActu, Fefe63]', () => { - expect(loader.loadAllUser()).toEqual(tabUS); - }) - }) - */ describe('loadById tests', () => { it('should return UserTest (id: 48)', () => { expect(loader.loadByID(48)).toEqual(tabUS[0]); @@ -66,11 +59,4 @@ describe('LoaderUserApi tests', () => { expect(loader.loadUserByConversation(convo)).toEqual(tabUS); }) }) - /* - describe('loadLastId', () => { - it('should return U0004', () => { - expect(loader.loadLastId()).toBe('U0004'); - }) - }) - */ }) \ No newline at end of file