parent
43f6fc415c
commit
604b0ed013
@ -0,0 +1,41 @@
|
||||
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,49 @@
|
||||
import { Message } from './Message';
|
||||
import { User } from './User';
|
||||
import { Conversation } from './Conversation';
|
||||
import { Skin } from './Skin';
|
||||
|
||||
// Instance
|
||||
let conv:Conversation[] = [];
|
||||
let tab:Skin[] = [];
|
||||
let classique = new Skin('Classique', 'wouhou');
|
||||
let dateBirth = new Date(2010,0o3,0o7);
|
||||
let usr = new User('00001', 'Killyan', 'France', 'M', dateBirth, 0, 0, classique, tab, conv);
|
||||
let usr2 = new User('00002', 'Karina', 'France', 'F', dateBirth, 5, 6, classique, tab, conv);
|
||||
let theDate = new Date(2022,10,14);
|
||||
let theDate2 = new Date(2022,10,13);
|
||||
let mess = new Message('Bob Party est le meilleur projet', usr, theDate);
|
||||
|
||||
|
||||
// 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);
|
||||
})
|
||||
})
|
@ -1,25 +1,31 @@
|
||||
import { Skin } from './Skin';
|
||||
|
||||
// Instance
|
||||
let classique = new Skin('Classique', 'wouhou');
|
||||
|
||||
test('skin Name : Classique', () => {
|
||||
expect(classique.getSkinName).toBe('Classique');
|
||||
});
|
||||
|
||||
describe('Get tests', () => {
|
||||
// Tests des get
|
||||
describe('Skin get tests', () => {
|
||||
it('should return Classique', () => {
|
||||
expect(classique.getSkinName).toBe('Classique');
|
||||
expect(classique.getSkinName()).toBe('Classique');
|
||||
})
|
||||
it('should return wouhou', () => {
|
||||
expect(classique.getSkinSource).toBe('wouhou');
|
||||
expect(classique.getSkinSource()).toBe('wouhou');
|
||||
})
|
||||
})
|
||||
|
||||
describe('Set tests', () => {
|
||||
|
||||
// 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.setSkinName('The Classique')).toBe('The Classique');
|
||||
expect(classique.getSkinName()).toBe('The Classique');
|
||||
})
|
||||
it('should return The wouhou', () => {
|
||||
expect(classique.setSkinSource('The wouhou')).toBe('The wouhou');
|
||||
expect(classique.getSkinSource()).toBe('The wouhou');
|
||||
})
|
||||
})
|
@ -0,0 +1,98 @@
|
||||
import { User } from './User';
|
||||
import { Skin } from './Skin';
|
||||
import { Conversation } from './Conversation';
|
||||
|
||||
|
||||
// Instances
|
||||
let classique = new Skin('Classique', 'wouhou');
|
||||
let kikou = new Skin('Kikou', 'trop beau');
|
||||
let tab:Skin[] = [];
|
||||
let tab2:Skin[] = [classique, kikou];
|
||||
let dateBirth = new Date(2010,0o3,0o7);
|
||||
let dateBirth2 = new Date(2009,0o3,0o7);
|
||||
let conv:Conversation[] = [];
|
||||
let conv2:Conversation[] = [];
|
||||
let usr = new User('00001', 'Killyan', 'France', 'M', dateBirth, 0, 0, classique, tab, conv);
|
||||
|
||||
|
||||
// Tests des get
|
||||
describe('User get tests', () => {
|
||||
it('should return 00001', () => {
|
||||
expect(usr.getId()).toBe('00001');
|
||||
})
|
||||
it('should return Killyan', () => {
|
||||
expect(usr.getUsername()).toBe('Killyan');
|
||||
})
|
||||
it('should return France', () => {
|
||||
expect(usr.getNationality()).toBe('France');
|
||||
})
|
||||
it('should return M', () => {
|
||||
expect(usr.getSexe()).toBe('M');
|
||||
})
|
||||
it('should return 2010-03-07 (dateBirth)', () => {
|
||||
expect(usr.getDateOfBirth()).toBe(dateBirth);
|
||||
})
|
||||
it('should return 0', () => {
|
||||
expect(usr.getCurrentCoins()).toBe(0);
|
||||
})
|
||||
it('should return 0', () => {
|
||||
expect(usr.getTotalCoins()).toBe(0);
|
||||
})
|
||||
it('should return classique', () => {
|
||||
expect(usr.getCurrentSkin()).toBe(classique);
|
||||
})
|
||||
it('should return tab', () => {
|
||||
expect(usr.getTabSkin()).toBe(tab);
|
||||
})
|
||||
it('should return conv', () => {
|
||||
expect(usr.getTabConv()).toBe(conv);
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
// Set de nouvelles valeurs
|
||||
usr.setId('00002');
|
||||
usr.setUsername('BgKillyan');
|
||||
usr.setNationality('Marseille');
|
||||
usr.setSexe('F');
|
||||
usr.setDateOfBirth(dateBirth2);
|
||||
usr.setCurrentCoins(2);
|
||||
usr.setTotalCoins(2);
|
||||
usr.setCurrentSkin(kikou);
|
||||
usr.setTabSkin(tab2);
|
||||
usr.setTabConv(conv2);
|
||||
|
||||
|
||||
// Tests des set
|
||||
describe('User get tests', () => {
|
||||
it('should return 00002', () => {
|
||||
expect(usr.getId()).toBe('00002');
|
||||
})
|
||||
it('should return BgKillyan', () => {
|
||||
expect(usr.getUsername()).toBe('BgKillyan');
|
||||
})
|
||||
it('should return Marseille', () => {
|
||||
expect(usr.getNationality()).toBe('Marseille');
|
||||
})
|
||||
it('should return F', () => {
|
||||
expect(usr.getSexe()).toBe('F');
|
||||
})
|
||||
it('should return 07/03/2009 (dateBirth2)', () => {
|
||||
expect(usr.getDateOfBirth()).toBe(dateBirth2);
|
||||
})
|
||||
it('should return 2', () => {
|
||||
expect(usr.getCurrentCoins()).toBe(2);
|
||||
})
|
||||
it('should return 2', () => {
|
||||
expect(usr.getTotalCoins()).toBe(2);
|
||||
})
|
||||
it('should return kikou', () => {
|
||||
expect(usr.getCurrentSkin()).toBe(kikou);
|
||||
})
|
||||
it('should return tab2', () => {
|
||||
expect(usr.getTabSkin()).toBe(tab2);
|
||||
})
|
||||
it('should return conv2', () => {
|
||||
expect(usr.getTabConv()).toBe(conv2);
|
||||
})
|
||||
})
|
Loading…
Reference in new issue