Advertisement
dilyana2001

Untitled

Oct 21st, 2021
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. describe('Cinema tests', () => {
  2.  
  3.     describe('showMovies', () => {
  4.  
  5.         it('Test 1', () => {
  6.             let movieArr = [];
  7.             expect(cinema.showMovies(movieArr)).to.equal(`There are currently no movies to show.`);
  8.         });
  9.  
  10.         it('Test 2', () => {
  11.             let movieArr = ['King Kong', 'The Tomorrow War', 'Joker'];
  12.             expect(cinema.showMovies(movieArr)).to.equal(movieArr.join(', '));
  13.         });
  14.  
  15.         it('Test 3', () => {
  16.             let movieArr = ['King Kong'];
  17.             expect(cinema.showMovies(movieArr)).to.equal(movieArr.join(', '));
  18.         });
  19.     });
  20.  
  21.     describe('ticketPrice', () => {
  22.         it('Test 1', () => {
  23.             let projectionType = 'Premiere';
  24.             expect(cinema.ticketPrice(projectionType)).to.equal(12);
  25.         });
  26.  
  27.         it('Test 2', () => {
  28.             let projectionType = 'Normal';
  29.             expect(cinema.ticketPrice(projectionType)).to.equal(7.50);
  30.         });
  31.  
  32.         it('Test 3', () => {
  33.             let projectionType = 'Discount';
  34.             expect(cinema.ticketPrice(projectionType)).to.equal(5.50);
  35.         });
  36.  
  37.         it('Test 4', () => {
  38.             let projectionType = 'Other';
  39.             expect(() => cinema.ticketPrice(projectionType)).to.throw();
  40.         });
  41.  
  42.         it('Test 5', () => {
  43.             let projectionType = '';
  44.             expect(() => cinema.ticketPrice(projectionType)).to.throw();
  45.         });
  46.  
  47.         it('Test 6', () => {
  48.             let projectionType = 0;
  49.             expect(() => cinema.ticketPrice(projectionType)).to.throw();
  50.         });
  51.     });
  52.  
  53.     describe('swapSeatsInHall', () => {
  54.         it('Test 1', () => {
  55.             let firstPlace = 0;
  56.             let secondPlace = 0;
  57.             expect(cinema.swapSeatsInHall(firstPlace, secondPlace)).to.equal(`Unsuccessful change of seats in the hall.`);
  58.         });
  59.  
  60.         it('Test 2', () => {
  61.             let firstPlace = 1;
  62.             let secondPlace = 1;
  63.             expect(cinema.swapSeatsInHall(firstPlace, secondPlace)).to.equal(`Unsuccessful change of seats in the hall.`);
  64.         });
  65.  
  66.         it('Test 3', () => {
  67.             let firstPlace = 20;
  68.             let secondPlace = 20;
  69.             expect(cinema.swapSeatsInHall(firstPlace, secondPlace)).to.equal(`Unsuccessful change of seats in the hall.`);
  70.         });
  71.  
  72.         it('Test 4', () => {
  73.             let firstPlace = 20;
  74.             let secondPlace = 0;
  75.             expect(cinema.swapSeatsInHall(firstPlace, secondPlace)).to.equal(`Unsuccessful change of seats in the hall.`);
  76.         });
  77.  
  78.         it('Test 5', () => {
  79.             let firstPlace = 19;
  80.             let secondPlace = 1;
  81.             expect(cinema.swapSeatsInHall(firstPlace, secondPlace)).to.equal(`Successful change of seats in the hall.`);
  82.         });
  83.  
  84.         it('Test 6', () => {
  85.             let firstPlace = 18;
  86.             let secondPlace = 2.5;
  87.             expect(cinema.swapSeatsInHall(firstPlace, secondPlace)).to.equal(`Unsuccessful change of seats in the hall.`);
  88.         });
  89.  
  90.         it('Test 7', () => {
  91.             let firstPlace = 18.5;
  92.             let secondPlace = 2.5;
  93.             expect(cinema.swapSeatsInHall(firstPlace, secondPlace)).to.equal(`Unsuccessful change of seats in the hall.`);
  94.         });
  95.  
  96.         it('Test 8', () => {
  97.             let firstPlace = 13.4;
  98.             let secondPlace = 5;
  99.             expect(cinema.swapSeatsInHall(firstPlace, secondPlace)).to.equal(`Unsuccessful change of seats in the hall.`);
  100.         });
  101.  
  102.         it('Test 9', () => {
  103.             let firstPlace = -5;
  104.             let secondPlace = 5;
  105.             expect(cinema.swapSeatsInHall(firstPlace, secondPlace)).to.equal(`Unsuccessful change of seats in the hall.`);
  106.         });
  107.  
  108.         it('Test 10', () => {
  109.             let firstPlace = 7;
  110.             let secondPlace = -7;
  111.             expect(cinema.swapSeatsInHall(firstPlace, secondPlace)).to.equal(`Unsuccessful change of seats in the hall.`);
  112.         });
  113.     });
  114. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement