Merge "Bug 140"
[osm/SO.git] / rwlaunchpad / mock / test / test_simmp.js
1 var assert = require('assert');
2
3 var simmp_module = require('../simmp.js');
4
5 // This is an example test on SimMp. It is not a very good test, but shows
6 // how to write a basic test in mocha
7 describe('SimMp', function() {
8 describe('#createSimMonitorFunc()', function () {
9 it('should return tx_rc_rate', function () {
10 var mp = {
11 id: 'tx-rate-pp1',
12 min_value: 0,
13 max_value: 100,
14 current_value: 0
15 };
16 var simmp = new simmp_module.SimMp({
17 "mp-mapper": { "tx-rate-pp1": "tx_rc_rate" }
18 });
19 assert(simmp != null, 'Could not instantiate simmp');
20 var func = simmp.createSimMonitorFunc(mp);
21 var value = func(0);
22 assert(value >= mp.min_value, 'value less than min value);
23 assert(value <= mp.max_value, 'value greater than max value');
24
25 });
26 });
27 });
28