2020-10-31 21:52:50 +07:00
|
|
|
import { BinaryConvert } from '../BinaryConvert'
|
|
|
|
|
|
2021-12-14 11:01:52 +05:30
|
|
|
describe('BinaryConvert', () => {
|
|
|
|
|
it('should return the correct value', () => {
|
|
|
|
|
expect(BinaryConvert(4)).toBe(100)
|
|
|
|
|
})
|
2020-10-31 21:52:50 +07:00
|
|
|
it('should return the correct value', () => {
|
|
|
|
|
expect(BinaryConvert(12)).toBe(1100)
|
|
|
|
|
})
|
|
|
|
|
it('should return the correct value of the sum from two number', () => {
|
|
|
|
|
expect(BinaryConvert(12 + 2)).toBe(1110)
|
|
|
|
|
})
|
2021-12-14 11:01:52 +05:30
|
|
|
it('should return the correct value of the subtract from two number', () => {
|
|
|
|
|
expect(BinaryConvert(245 - 56)).toBe(10111101)
|
|
|
|
|
})
|
|
|
|
|
it('should return the correct value', () => {
|
|
|
|
|
expect(BinaryConvert(254)).toBe(11111110)
|
|
|
|
|
})
|
|
|
|
|
it('should return the correct value', () => {
|
|
|
|
|
expect(BinaryConvert(63483)).toBe(1111011111111011)
|
|
|
|
|
})
|
2020-10-31 21:52:50 +07:00
|
|
|
})
|