trade360-nodejs-sdk
Version:
LSports Trade360 SDK for Node.js
93 lines • 5.43 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const participant_body_structure_1 = require("../../../../../src/api/common/body-entities/responses/participant-body-structure");
const gender_enum_1 = require("../../../../../src/api/common/body-entities/responses/gender.enum");
const age_category_enum_1 = require("../../../../../src/api/common/body-entities/responses/age-category.enum");
const participant_type_enum_1 = require("../../../../../src/api/common/body-entities/responses/participant-type.enum");
describe('ParticipantBodyStructure', () => {
it('should instantiate with default values', () => {
const participant = new participant_body_structure_1.ParticipantBodyStructure();
expect(participant).toBeInstanceOf(participant_body_structure_1.ParticipantBodyStructure);
expect(participant.id).toBeUndefined();
expect(participant.sportId).toBeUndefined();
expect(participant.locationId).toBeUndefined();
expect(participant.name).toBeUndefined();
expect(participant.gender).toBeUndefined();
expect(participant.ageCategory).toBeUndefined();
expect(participant.type).toBeUndefined();
});
it('should set and get all properties', () => {
const participant = new participant_body_structure_1.ParticipantBodyStructure();
participant.id = 123;
participant.sportId = 6046;
participant.locationId = 142;
participant.name = 'Manchester United';
participant.gender = gender_enum_1.Gender.Men;
participant.ageCategory = age_category_enum_1.AgeCategory.Regular;
participant.type = participant_type_enum_1.ParticipantType.Club;
expect(participant.id).toBe(123);
expect(participant.sportId).toBe(6046);
expect(participant.locationId).toBe(142);
expect(participant.name).toBe('Manchester United');
expect(participant.gender).toBe(gender_enum_1.Gender.Men);
expect(participant.ageCategory).toBe(age_category_enum_1.AgeCategory.Regular);
expect(participant.type).toBe(participant_type_enum_1.ParticipantType.Club);
});
it('should handle nullable enum properties', () => {
const participant = new participant_body_structure_1.ParticipantBodyStructure();
participant.id = 100;
participant.sportId = 1;
participant.locationId = 5;
participant.name = 'Test Participant';
participant.gender = null;
participant.ageCategory = null;
participant.type = null;
expect(participant.id).toBe(100);
expect(participant.sportId).toBe(1);
expect(participant.locationId).toBe(5);
expect(participant.name).toBe('Test Participant');
expect(participant.gender).toBeNull();
expect(participant.ageCategory).toBeNull();
expect(participant.type).toBeNull();
});
it('should handle different gender values', () => {
const participant = new participant_body_structure_1.ParticipantBodyStructure();
participant.gender = gender_enum_1.Gender.Women;
expect(participant.gender).toBe(gender_enum_1.Gender.Women);
expect(participant.gender).toBe(2);
participant.gender = gender_enum_1.Gender.Mix;
expect(participant.gender).toBe(gender_enum_1.Gender.Mix);
expect(participant.gender).toBe(3);
});
it('should handle different age category values', () => {
const participant = new participant_body_structure_1.ParticipantBodyStructure();
participant.ageCategory = age_category_enum_1.AgeCategory.Youth;
expect(participant.ageCategory).toBe(age_category_enum_1.AgeCategory.Youth);
expect(participant.ageCategory).toBe(1);
participant.ageCategory = age_category_enum_1.AgeCategory.Reserves;
expect(participant.ageCategory).toBe(age_category_enum_1.AgeCategory.Reserves);
expect(participant.ageCategory).toBe(2);
});
it('should handle different participant type values', () => {
const participant = new participant_body_structure_1.ParticipantBodyStructure();
participant.type = participant_type_enum_1.ParticipantType.National;
expect(participant.type).toBe(participant_type_enum_1.ParticipantType.National);
expect(participant.type).toBe(2);
participant.type = participant_type_enum_1.ParticipantType.Individual;
expect(participant.type).toBe(participant_type_enum_1.ParticipantType.Individual);
expect(participant.type).toBe(3);
participant.type = participant_type_enum_1.ParticipantType.Virtual;
expect(participant.type).toBe(participant_type_enum_1.ParticipantType.Virtual);
expect(participant.type).toBe(4);
participant.type = participant_type_enum_1.ParticipantType.Esports;
expect(participant.type).toBe(participant_type_enum_1.ParticipantType.Esports);
expect(participant.type).toBe(5);
participant.type = participant_type_enum_1.ParticipantType.VirtuReal;
expect(participant.type).toBe(participant_type_enum_1.ParticipantType.VirtuReal);
expect(participant.type).toBe(6);
participant.type = participant_type_enum_1.ParticipantType.Doubles;
expect(participant.type).toBe(participant_type_enum_1.ParticipantType.Doubles);
expect(participant.type).toBe(7);
});
});
//# sourceMappingURL=participant-body-structure.spec.js.map