|
| 1 | +import { expect } from 'chai'; |
| 2 | +import { CollectionResponse } from '../src/models/CollectionResponse'; |
| 3 | + |
| 4 | +describe('CollectionResponse', function () { |
| 5 | + it('should be defined', function () { |
| 6 | + expect(CollectionResponse).to.not.be.undefined; |
| 7 | + }); |
| 8 | + |
| 9 | + it('should have a constructor', function () { |
| 10 | + expect(CollectionResponse).to.have.property('constructor'); |
| 11 | + }); |
| 12 | + |
| 13 | + it('should have 2 parameters', function () { |
| 14 | + expect(CollectionResponse).to.have.lengthOf(2); |
| 15 | + }); |
| 16 | + |
| 17 | + it('should create a new instance of the CollectionResponse class', function () { |
| 18 | + expect(() => new CollectionResponse(200, [1, 2, 3])).to.not.throw(); |
| 19 | + }); |
| 20 | + |
| 21 | + it('should have a property named count', function () { |
| 22 | + expect(new CollectionResponse(200, [1, 2, 3])).to.have.property('count'); |
| 23 | + }); |
| 24 | + |
| 25 | + it('should have a property named items', function () { |
| 26 | + expect(new CollectionResponse(200, [1, 2, 3])).to.have.property('items'); |
| 27 | + }); |
| 28 | + |
| 29 | + it('should set the count property to the value passed to the constructor', function () { |
| 30 | + expect(new CollectionResponse(200, [1, 2, 3]).count).to.equal(200); |
| 31 | + }); |
| 32 | + |
| 33 | + it('should set the items property to the value passed to the constructor', function () { |
| 34 | + expect(new CollectionResponse(200, [1, 2, 3]).items).to.deep.equal([ |
| 35 | + 1, 2, 3, |
| 36 | + ]); |
| 37 | + }); |
| 38 | +}); |
0 commit comments