summaryrefslogtreecommitdiff
path: root/test/unit_tests/binaryConverter.test.js
blob: 109dee161a8106114007076eaa7eef0cb968de9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const BinaryConverter = require('../../src/binaryConverter');
const math = require('mathjs');

//import BinaryConverter from 'binaryConverter';

describe('Test BinaryConversion module', () => {
	
	let testConverter;
	let testVector;
	let testInteger;

	beforeEach(() => {
		testConverter = new BinaryConverter(2);
		testInteger = 2;
		testVector = math.matrix([1, 0]);
	});


	test('convert integer to binary array', () => {
		testConverter.integer = testInteger;
		expect(testConverter.inputActivation).toEqual(testVector);
	});

	test('convert binary array to integer', () => {
		testConverter.inputActivation = testVector;
		expect(testConverter.integer).toEqual(testInteger);
	});

	test.todo('Random array initializes correct integer');

});