const chai = require('chai');
const assert = chai.assert;
// const stub = require('./support/stub')
const Num = require("../lib/num")


describe("Num", function(){

  context("with calculated attributes", function(){

    it("instantiates", function(){
      assert.isObject(new Num(10));
    })

    it('has a decimal attribute', function(){
      let num = new Num(10);
      assert.isAbove(num.decimal, 0)
      assert.isAtMost(num.decimal, 10)
    })

    it('has a binary attribute', function(){
      let num = new Num(10);
      let decimal = num.decimal
      assert.equal(num.binary, (decimal >>> 0).toString(2))
    })
  })
})

const chai = require('chai');
const assert = chai.assert;
// const stub = require('./support/stub')
const Num = require("../lib/num")


describe("Num", function(){

  context("with calculated attributes", function(){

    it("instantiates", function(){
      assert.isObject(new Num(10));
    })

    it('has a decimal attribute', function(){
      let num = new Num(10);
      assert.isAbove(num.decimal, 0)
      assert.isAtMost(num.decimal, 10)
    })

    it('has a binary attribute', function(){
      let num = new Num(10);
      let decimal = num.decimal
      assert.equal(num.binary, (decimal >>> 0).toString(2))
    })
  })
})

describe("translateToBinary", function(){

  it("translate a decimal number to binary", function(){
    let num = new Num(2);
    num.decimal = 2;
    assert.equal(num.decimal, 2);
    assert.equal(num.translateToBinary(), 10);
  })
})

Add test for Num method translating a decimal to binary
Add test for Num method translating a decimal to binary
