it('should return a bits per pixel value of 8', function(done) { readwrite.bitmapReader(__dirname + '/../bitmap1.bmp', function(err, data) { var testobject = new bitobject.Buffobject(data); expect(testobject.bitsperpixel).to.equal(8); done(); }); });
it('output a string', function(done) { readwrite.bitmapReader(__dirname + '/../bitmap1.bmp', function(err, data) { var testobject = new bitobject.Buffobject(data); expect(transform.randomcolor(testobject)).to.be.a('string'); done(); }); });
it('should return a height of 100', function(done) { readwrite.bitmapReader(__dirname + '/../bitmap1.bmp', function(err, data) { var testobject = new bitobject.Buffobject(data); expect(testobject.height).to.equal(100); done(); }); });
it('should return a buffer of hex', function(done) { readwrite.bitmapReader(__dirname + '/../bitmap1.bmp', function(err, data) { expect(err).to.equal(null); expect(data.toString('hex', 0, 14)).to.equal('424d462b00000000000036040000'); done(); }); });
it('should return 256 important colors', function(done) { readwrite.bitmapReader(__dirname + '/../bitmap1.bmp', function(err, data) { var testobject = new bitobject.Buffobject(data); expect(testobject.importantcolors).to.equal(256); done(); }); });
it ('should return 11078 as the size', function(done) { readwrite.bitmapReader(__dirname + '/../bitmap1.bmp', function(err, data) { var testobject = new bitobject.Buffobject(data); expect(testobject.size).to.equal(11078); done(); }); });
it('should return BM from file header', function(done) { readwrite.bitmapReader(__dirname + '/../bitmap1.bmp', function(err, data) { var testobject = new bitobject.Buffobject(data); expect(testobject.bheader.toString('utf8')).to.equal('BM'); done(); }); });
it('should have 6 characters', function(done) { readwrite.bitmapReader(__dirname + '/../bitmap1.bmp', function(err, data) { var testobject = new bitobject.Buffobject(data); expect(transform.randomcolor(testobject)).to.have.length.of(6); done(); }); });
it('should fill the colorpallet with blue', function(done){ readwrite.bitmapReader(__dirname + '/../bitmap1.bmp', (err, data) => { if (err) throw err; var bitmapObject = new bitobject.Buffobject(data); transform.singTheBlues(bitmapObject); expect(err).to.equal(err); expect(bitmapObject.colorpalette.toString('utf8')).to.equal('#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0000EE#0'); done(); }); });