Advertisement
radostina92

cinema

Aug 12th, 2021
791
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. describe("Tests …", function() {
  2.     describe("showMovies", function() {
  3.         it("if no movies", function() {
  4.          assert.equal(cinema.showMovies([]), 'There are currently no movies to show.');
  5.         });
  6.  
  7.         it("if there are movies", function() {
  8.             assert.deepEqual(cinema.showMovies(['hello', 'gaga']), 'hello, gaga');
  9.            });
  10.      });
  11.  
  12.      describe("ticketPrice", function() {
  13.         it("valid ticket", function() {
  14.            assert.equal(cinema.ticketPrice('Premiere'), 12.00);
  15.         });
  16.         it("valid ticket2", function() {
  17.             assert.equal(cinema.ticketPrice('Normal'), 7.50);
  18.          });
  19.  
  20.          it("valid ticket3", function() {
  21.             assert.equal(cinema.ticketPrice('Discount'), 5.50);
  22.          });
  23.  
  24.         it("invalid ticket", function() {
  25.             assert.throw(() => {
  26.                 cinema.ticketPrice('Loja'), Error, 'Invalid projection type.'
  27.             });
  28.          });
  29.  
  30.          it("invalid ticket2", function() {
  31.             assert.throw(() => {
  32.                 cinema.ticketPrice(''), Error, 'Invalid projection type.'
  33.             });
  34.          });
  35.      });
  36.  
  37.      describe("swapSeatsInHall", function() {
  38.         it("correct", function() {
  39.            assert.equal(cinema.swapSeatsInHall(5, 10), "Successful change of seats in the hall.");
  40.         });
  41.  
  42.         it("not correct", function() {
  43.             assert.equal(cinema.swapSeatsInHall(5.5, 10), "Unsuccessful change of seats in the hall.");
  44.         });
  45.  
  46.         it("not correct2", function() {
  47.             assert.equal(cinema.swapSeatsInHall(5, 10.5), "Unsuccessful change of seats in the hall.");
  48.         });
  49.  
  50.         it("not correct3", function() {
  51.             assert.equal(cinema.swapSeatsInHall(-5, 10.5), "Unsuccessful change of seats in the hall.");
  52.         });
  53.  
  54.         it("not correct4", function() {
  55.             assert.equal(cinema.swapSeatsInHall('a', 5), "Unsuccessful change of seats in the hall.");
  56.         });
  57.  
  58.         it("not correct5", function() {
  59.             assert.equal(cinema.swapSeatsInHall(3, 'a'), "Unsuccessful change of seats in the hall.");
  60.         });
  61.  
  62.         it("not correct5", function() {
  63.             assert.equal(cinema.swapSeatsInHall(3, -1), "Unsuccessful change of seats in the hall.");
  64.         });
  65.  
  66.         it("not correct5", function() {
  67.             assert.equal(cinema.swapSeatsInHall(3, 0), "Unsuccessful change of seats in the hall.");
  68.         });
  69.         it("not correct5", function() {
  70.             assert.equal(cinema.swapSeatsInHall(0, 3), "Unsuccessful change of seats in the hall.");
  71.         });
  72.  
  73.         it("not correct5", function() {
  74.             assert.equal(cinema.swapSeatsInHall(20, 5), "Successful change of seats in the hall.");
  75.         });
  76.  
  77.         it("not correct5", function() {
  78.             assert.equal(cinema.swapSeatsInHall(5, 20), "Successful change of seats in the hall.");
  79.         });
  80.      });
  81.      
  82. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement