Advertisement
ilianrusev

Untitled

Feb 1st, 2022
29
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. describe("Tests …", () => {
  2. describe("showMovies method", () => {
  3. it("if there are no movies", () => {
  4. expect(cinema.showMovies([])).to.be.equal("There are currently no movies to show.")
  5. })
  6. it("return movies", () => {
  7. expect(cinema.showMovies(['King Kong', 'The Tomorrow War', 'Joker'])).to.be.equal("King Kong, The Tomorrow War, Joker")
  8. })
  9. it("return movies", () => {
  10. expect(cinema.showMovies(['King Kong'])).to.be.equal("King Kong")
  11. })
  12. })
  13.  
  14. describe("ticketPrice method", () => {
  15. it("invalid projection", () => {
  16. expect(() => {
  17. cinema.ticketPrice("invalid")
  18. }).to.throw("Invalid projection type.")
  19. })
  20. it("valid projection", () => {
  21. expect(cinema.ticketPrice("Premiere")).to.be.equal(12.00)
  22. })
  23. it("valid projection", () => {
  24. expect(cinema.ticketPrice("Normal")).to.be.equal(7.50)
  25. })
  26. it("valid projection", () => {
  27. expect(cinema.ticketPrice("Discount")).to.be.equal(5.50)
  28. })
  29. })
  30.  
  31. describe("swapSeatsInHall method", () => {
  32. it("not successful exchange", () => {
  33. expect(cinema.swapSeatsInHall(7.5, 5)).to.be.equal("Unsuccessful change of seats in the hall.")
  34. })
  35. it("not successful exchange", () => {
  36. expect(cinema.swapSeatsInHall(7, 5.5)).to.be.equal("Unsuccessful change of seats in the hall.")
  37. })
  38. it("not successful exchange", () => {
  39. expect(cinema.swapSeatsInHall(25, 5)).to.be.equal("Unsuccessful change of seats in the hall.")
  40. })
  41. it("not successful exchange", () => {
  42. expect(cinema.swapSeatsInHall(7, 25)).to.be.equal("Unsuccessful change of seats in the hall.")
  43. })
  44. it("not successful exchange", () => {
  45. expect(cinema.swapSeatsInHall(0, 5)).to.be.equal("Unsuccessful change of seats in the hall.")
  46. })
  47. it("not successful exchange", () => {
  48. expect(cinema.swapSeatsInHall(-1, 5)).to.be.equal("Unsuccessful change of seats in the hall.")
  49. })
  50. it("not successful exchange", () => {
  51. expect(cinema.swapSeatsInHall(5, -5)).to.be.equal("Unsuccessful change of seats in the hall.")
  52. })
  53. it("not successful exchange", () => {
  54. expect(cinema.swapSeatsInHall(2, 0)).to.be.equal("Unsuccessful change of seats in the hall.")
  55. })
  56. it("not successful exchange", () => {
  57. expect(cinema.swapSeatsInHall(5)).to.be.equal("Unsuccessful change of seats in the hall.")
  58. })
  59. it("not successful exchange", () => {
  60. expect(cinema.swapSeatsInHall(5, 5)).to.be.equal("Unsuccessful change of seats in the hall.")
  61. })
  62. it("successful exchange", () => {
  63. expect(cinema.swapSeatsInHall(5, 7)).to.be.equal("Successful change of seats in the hall.")
  64. })
  65.  
  66. })
  67. });
  68.  
Advertisement
RAW Paste Data Copied
Advertisement