Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- describe("Tests …", function() {
- describe("showMovies", function() {
- it("if no movies", function() {
- assert.equal(cinema.showMovies([]), 'There are currently no movies to show.');
- });
- it("if there are movies", function() {
- assert.deepEqual(cinema.showMovies(['hello', 'gaga']), 'hello, gaga');
- });
- });
- describe("ticketPrice", function() {
- it("valid ticket", function() {
- assert.equal(cinema.ticketPrice('Premiere'), 12.00);
- });
- it("valid ticket2", function() {
- assert.equal(cinema.ticketPrice('Normal'), 7.50);
- });
- it("valid ticket3", function() {
- assert.equal(cinema.ticketPrice('Discount'), 5.50);
- });
- it("invalid ticket", function() {
- assert.throw(() => {
- cinema.ticketPrice('Loja'), Error, 'Invalid projection type.'
- });
- });
- it("invalid ticket2", function() {
- assert.throw(() => {
- cinema.ticketPrice(''), Error, 'Invalid projection type.'
- });
- });
- });
- describe("swapSeatsInHall", function() {
- it("correct", function() {
- assert.equal(cinema.swapSeatsInHall(5, 10), "Successful change of seats in the hall.");
- });
- it("not correct", function() {
- assert.equal(cinema.swapSeatsInHall(5.5, 10), "Unsuccessful change of seats in the hall.");
- });
- it("not correct2", function() {
- assert.equal(cinema.swapSeatsInHall(5, 10.5), "Unsuccessful change of seats in the hall.");
- });
- it("not correct3", function() {
- assert.equal(cinema.swapSeatsInHall(-5, 10.5), "Unsuccessful change of seats in the hall.");
- });
- it("not correct4", function() {
- assert.equal(cinema.swapSeatsInHall('a', 5), "Unsuccessful change of seats in the hall.");
- });
- it("not correct5", function() {
- assert.equal(cinema.swapSeatsInHall(3, 'a'), "Unsuccessful change of seats in the hall.");
- });
- it("not correct5", function() {
- assert.equal(cinema.swapSeatsInHall(3, -1), "Unsuccessful change of seats in the hall.");
- });
- it("not correct5", function() {
- assert.equal(cinema.swapSeatsInHall(3, 0), "Unsuccessful change of seats in the hall.");
- });
- it("not correct5", function() {
- assert.equal(cinema.swapSeatsInHall(0, 3), "Unsuccessful change of seats in the hall.");
- });
- it("not correct5", function() {
- assert.equal(cinema.swapSeatsInHall(20, 5), "Successful change of seats in the hall.");
- });
- it("not correct5", function() {
- assert.equal(cinema.swapSeatsInHall(5, 20), "Successful change of seats in the hall.");
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement