-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
written couple of unit test cases for julian day functionality
- Loading branch information
Chandan Tiwari
committed
May 20, 2015
1 parent
3385cad
commit b9f56a6
Showing
2 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
/** | ||
* Created by chandan on 09/05/15. | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); | ||
}); | ||
|
||
}); |