bitcore/test/test.SIN.js

42 lines
977 B
JavaScript
Raw Normal View History

2014-02-17 12:55:56 -08:00
'use strict';
var chai = chai || require('chai');
var bitcore = bitcore || require('../bitcore');
2014-02-17 12:55:56 -08:00
var should = chai.should();
2014-07-10 13:17:24 -07:00
var SIN = bitcore.SIN;
2014-02-17 12:55:56 -08:00
2014-02-19 11:07:50 -08:00
describe('SIN', function() {
2014-02-17 12:55:56 -08:00
it('should be able to create class', function() {
2014-02-19 11:07:50 -08:00
should.exist(SIN);
2014-02-17 12:55:56 -08:00
});
it('should be able to create instance', function() {
2014-02-19 11:07:50 -08:00
var s = new SIN();
should.exist(s);
2014-02-17 12:55:56 -08:00
});
2014-07-10 13:17:24 -07:00
it('should be able to convert to string', function() {
var s = new SIN('6bqov85Hsatqb8eLtwLW1PBQLWVNJkzPwgdAT3SYNkB6X2aF2n');
s.toString.bind(s).should.not.throw();
});
var data = [
['6bqov85Hsatqb8eLtwLW1PBQLWVNJkzPwgdAT3SYNkB6X2aF2n', false],
];
data.forEach(function(datum) {
var sin = datum[0];
var result = datum[1];
it('should validate correctly ' + sin, function() {
var a = new SIN(sin);
var s = a.toString();
a.isValid().should.equal(result);
s.should.equal(a.toString()); // check that validation doesn't change data
});
});
2014-02-17 12:55:56 -08:00
});
2014-02-19 11:07:50 -08:00