Commit f1852a86 authored by GoshaZotov's avatar GoshaZotov

add tests for RRI formula

parent 10ee1e0a
......@@ -5910,6 +5910,30 @@ $( function () {
} );
test( "Test: \"RRI\"", function () {
oParser = new parserFormula( "RRI(96, 10000, 11000)", "A2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue().toFixed(7) - 0, 0.0009933 );
oParser = new parserFormula( "RRI(0, 10000, 11000)", "A2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue(), "#NUM!" );
oParser = new parserFormula( "RRI(-10, 10000, 11000)", "A2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue(), "#NUM!" );
oParser = new parserFormula( "RRI(10, 10000, -11000)", "A2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue(), "#NUM!" );
oParser = new parserFormula( "RRI(1, 1, -1)", "A2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue(), -2 );
} );
test( "Test: \"INTRATE\"", function () {
function intrate( settlement, maturity, investment, redemption, basis ){
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment