Advertisement
viligen

cinema

Jun 17th, 2022
1,086
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. describe('Tests cinema', function () {
  2.     describe('showMovies ', function () {
  3.         it('assert with valid params', function () {
  4.             assert.equal(
  5.                 cinema.showMovies(['King Kong', 'The Tomorrow War', 'Joker']),
  6.                 'King Kong, The Tomorrow War, Joker'
  7.             );
  8.             assert.equal(cinema.showMovies(['Joker']), 'Joker');
  9.             assert.equal(
  10.                 cinema.showMovies([]),
  11.                 'There are currently no movies to show.'
  12.             );
  13.         });
  14.     });
  15.  
  16.     describe('ticketPrice', function () {
  17.         it('assert  with valid param', function () {
  18.             assert.equal(cinema.ticketPrice('Premiere'), 12);
  19.             assert.equal(cinema.ticketPrice('Normal'), 7.5);
  20.              assert.equal(cinema.ticketPrice('Discount'), 5.5);
  21.         });
  22.         it('assert  with invalid param', function () {
  23.             assert.throw(
  24.                 () => cinema.ticketPrice('Premi'),
  25.                 'Invalid projection type.'
  26.             );
  27.            assert.throw(
  28.                () => cinema.ticketPrice(''),
  29.                'Invalid projection type.'
  30.            );
  31.            assert.throw(
  32.                () => cinema.ticketPrice(),
  33.                'Invalid projection type.'
  34.            );
  35.         });
  36.     });
  37.     describe('swapSeatsInHall', function () {
  38.         it('assert with valid params', function () {
  39.             assert.equal(cinema.swapSeatsInHall(1, 20), 'Successful change of seats in the hall.');
  40.             assert.equal(
  41.                 cinema.swapSeatsInHall(19, 20),
  42.                 'Successful change of seats in the hall.'
  43.             );
  44.             assert.equal(
  45.                 cinema.swapSeatsInHall(20, 19),
  46.                 'Successful change of seats in the hall.'
  47.             );
  48.         });
  49.         it('assert with invalid params', function () {
  50.             assert.equal(
  51.                  cinema.swapSeatsInHall(20, 20),
  52.                 'Unsuccessful change of seats in the hall.'
  53.             );
  54.             assert.equal(
  55.                 cinema.swapSeatsInHall(0, 1),
  56.                 'Unsuccessful change of seats in the hall.'
  57.             );
  58.             assert.equal(
  59.                 cinema.swapSeatsInHall(1, 0),
  60.                 'Unsuccessful change of seats in the hall.'
  61.             );
  62.              assert.equal(
  63.                  cinema.swapSeatsInHall(-1, 9),
  64.                  'Unsuccessful change of seats in the hall.'
  65.              );
  66.               assert.equal(
  67.                   cinema.swapSeatsInHall(2, -9),
  68.                   'Unsuccessful change of seats in the hall.'
  69.               );
  70.               assert.equal(
  71.                   cinema.swapSeatsInHall(2, 21),
  72.                   'Unsuccessful change of seats in the hall.'
  73.               );
  74.               assert.equal(
  75.                   cinema.swapSeatsInHall(21, 7),
  76.                   'Unsuccessful change of seats in the hall.'
  77.               );
  78.               assert.equal(
  79.                   cinema.swapSeatsInHall('9', 7),
  80.                   'Unsuccessful change of seats in the hall.'
  81.               );
  82.               assert.equal(
  83.                   cinema.swapSeatsInHall(9, '7'),
  84.                   'Unsuccessful change of seats in the hall.'
  85.               );
  86.                assert.equal(
  87.                    cinema.swapSeatsInHall(5.5, 7),
  88.                    'Unsuccessful change of seats in the hall.'
  89.                );
  90.                assert.equal(
  91.                    cinema.swapSeatsInHall(9, 4.6),
  92.                    'Unsuccessful change of seats in the hall.'
  93.                );
  94.  
  95.                 assert.equal(
  96.                     cinema.swapSeatsInHall(7,),
  97.                     'Unsuccessful change of seats in the hall.'
  98.                 );
  99.                 assert.equal(
  100.                     cinema.swapSeatsInHall(null, 6),
  101.                     'Unsuccessful change of seats in the hall.'
  102.                 );
  103.         });
  104.     });
  105. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement