Skip to content

Commit

Permalink
written couple of unit test cases for julian day functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
Chandan Tiwari committed May 20, 2015
1 parent 3385cad commit b9f56a6
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/routes.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/**
* Created by chandan on 09/05/15.
*/


58 changes: 58 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,61 @@
/**
* Created by chandan on 09/05/15.
*/

'use strict';


var should = require('should'),
assert = require('assert');

describe(' Unit Tests ', function(){

var astronomy = require('../core/astronomy');

it('should return the julian day for 20th May 2015 as 2457163', function(done){

var data = {

date : 20,
month : 5,
year: 2015,
hour : 21,
minute : 23,
timezone : 5.5
};

astronomy.getJulianDay(data, function(error, response){

(error === null).should.be.equal(true);

response.should.not.be.equal(undefined);
response.should.be.a.Number;
response.should.be.equal(2457163.1618055557);
done();
});
});

it('should return the julian day for 2nd March 1905 as 2457163', function(done){

var data = {

date : 2,
month : 3,
year: 1905,
hour : 8,
minute : 20,
timezone : 0
};

astronomy.getJulianDay(data, function(error, response){

(error === null).should.be.equal(true);

response.should.not.be.equal(undefined);
response.should.be.a.Number;
response.should.be.equal(2416906.847222222);
done();
});
});

});

0 comments on commit b9f56a6

Please sign in to comment.