Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- describe("Tests …", () => {
- describe("showMovies method", () => {
- it("if there are no movies", () => {
- expect(cinema.showMovies([])).to.be.equal("There are currently no movies to show.")
- })
- it("return movies", () => {
- expect(cinema.showMovies(['King Kong', 'The Tomorrow War', 'Joker'])).to.be.equal("King Kong, The Tomorrow War, Joker")
- })
- it("return movies", () => {
- expect(cinema.showMovies(['King Kong'])).to.be.equal("King Kong")
- })
- })
- describe("ticketPrice method", () => {
- it("invalid projection", () => {
- expect(() => {
- cinema.ticketPrice("invalid")
- }).to.throw("Invalid projection type.")
- })
- it("valid projection", () => {
- expect(cinema.ticketPrice("Premiere")).to.be.equal(12.00)
- })
- it("valid projection", () => {
- expect(cinema.ticketPrice("Normal")).to.be.equal(7.50)
- })
- it("valid projection", () => {
- expect(cinema.ticketPrice("Discount")).to.be.equal(5.50)
- })
- })
- describe("swapSeatsInHall method", () => {
- it("not successful exchange", () => {
- expect(cinema.swapSeatsInHall(7.5, 5)).to.be.equal("Unsuccessful change of seats in the hall.")
- })
- it("not successful exchange", () => {
- expect(cinema.swapSeatsInHall(7, 5.5)).to.be.equal("Unsuccessful change of seats in the hall.")
- })
- it("not successful exchange", () => {
- expect(cinema.swapSeatsInHall(25, 5)).to.be.equal("Unsuccessful change of seats in the hall.")
- })
- it("not successful exchange", () => {
- expect(cinema.swapSeatsInHall(7, 25)).to.be.equal("Unsuccessful change of seats in the hall.")
- })
- it("not successful exchange", () => {
- expect(cinema.swapSeatsInHall(0, 5)).to.be.equal("Unsuccessful change of seats in the hall.")
- })
- it("not successful exchange", () => {
- expect(cinema.swapSeatsInHall(-1, 5)).to.be.equal("Unsuccessful change of seats in the hall.")
- })
- it("not successful exchange", () => {
- expect(cinema.swapSeatsInHall(5, -5)).to.be.equal("Unsuccessful change of seats in the hall.")
- })
- it("not successful exchange", () => {
- expect(cinema.swapSeatsInHall(2, 0)).to.be.equal("Unsuccessful change of seats in the hall.")
- })
- it("not successful exchange", () => {
- expect(cinema.swapSeatsInHall(5)).to.be.equal("Unsuccessful change of seats in the hall.")
- })
- it("not successful exchange", () => {
- expect(cinema.swapSeatsInHall(5, 5)).to.be.equal("Unsuccessful change of seats in the hall.")
- })
- it("successful exchange", () => {
- expect(cinema.swapSeatsInHall(5, 7)).to.be.equal("Successful change of seats in the hall.")
- })
- })
- });
Advertisement
RAW Paste Data
Copied
Advertisement