Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- describe("Film Studio", function () {
- let sampleInstance;
- beforeEach(function () {
- sampleInstance = new FilmStudio('Pesho');
- });
- it('testing constructor studioName property', function () {
- expect(sampleInstance.name).to.deep.equal('Pesho');
- });
- it('testing constructor films property', function () {
- expect(sampleInstance.films).to.deep.equal([]);
- });
- it('testing makeMovie filmName', function () {
- let result = sampleInstance.makeMovie('The Avengers', ['Iron-Man', 'Thor', 'Hulk', 'Arrow guy']);
- expect(result.filmName).to.deep.equal(`The Avengers`);
- });
- it('testing makeMovie roles', function () {
- let result = sampleInstance.makeMovie('The Avengers', ['Iron-Man', 'Thor', 'Hulk', 'Arrow guy']);
- expect(result.filmRoles).to.deep.equal([ { role: 'Iron-Man', actor: false }, { role: 'Thor', actor: false }, { role: 'Hulk', actor: false }, { role: 'Arrow guy', actor: false } ]);
- });
- it('testing makeMovie with few args', function () {
- expect(()=>sampleInstance.makeMovie( ['Iron-Man', 'Thor', 'Hulk', 'Arrow guy'])).to.throw('Invalid arguments count');
- });
- it('testing makeMovie with WRONG args', function () {
- expect(()=>sampleInstance.makeMovie(1, ['Iron-Man', 'Thor', 'Hulk', 'Arrow guy'])).to.throw('Invalid arguments');
- });
- it('testing makeMovie with WRONG args', function () {
- sampleInstance.makeMovie('The Avengers', ['Iron-Man', 'Thor', 'Hulk', 'Arrow guy']);
- expect(()=>sampleInstance.lookForProducer('Gosho')).to.throw('Gosho do not exist yet, but we need the money...');
- });
- it('testing makeMovie with RIGHT args', function () {
- sampleInstance.makeMovie('The Avengers', ['Iron-Man']);
- result = sampleInstance.lookForProducer('The Avengers')
- expect(result).to.deep.equal(`Film name: The Avengers\nCast:\nfalse as Iron-Man\n`);
- });
- it('testing makeMovie with RIGHT casting', function () {
- sampleInstance.makeMovie('The Avengers', ['Iron-Man']);
- result = sampleInstance.casting('Pesho','Iron-Man')
- expect(result).to.deep.equal(`You got the job! Mr. Pesho you are next Iron-Man in the The Avengers. Congratz!`);
- });
- it('testing makeMovie with RIGHT casting', function () {
- sampleInstance.makeMovie('The Avengers', ['Iron-Man']);
- result = sampleInstance.casting('Pesho','WRONG')
- expect(result).to.deep.equal(`Pesho, we cannot find a WRONG role...`);
- });
- it('testing makeMovie with RIGHT casting', function () {
- result = sampleInstance.casting('Pesho','WRONG')
- expect(result).to.deep.equal(`There are no films yet in Pesho.`);
- });
- it('testing makeMovie with RIGHT casting', function () {
- sampleInstance.makeMovie('The Avengers', ['Iron-Man']);
- sampleInstance.makeMovie('Hulk', ['Iron-Man']);
- result = sampleInstance.casting('Pesho','Iron-Man')
- expect(result).to.deep.equal(`You got the job! Mr. Pesho you are next Iron-Man in the The Avengers. Congratz!`);
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement