mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Add tests.
Update definition.
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
/// <reference path="iban.d.ts" />
|
||||
|
||||
/**
|
||||
* @summary Test for "electronicFormat" method.
|
||||
*/
|
||||
function testElectronicFormat() {
|
||||
var iban: string = 'BE68539007547034';
|
||||
var format: string = IBAN.electronicFormat(iban);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for "fromBBAN" method.
|
||||
*/
|
||||
function testFromBBAN() {
|
||||
var countryCode: string = 'fr';
|
||||
var bban: string = 'BBBBBGGGGGCCCCCCCCCCCKK';
|
||||
var iban: string = IBAN.fromBBAN(countryCode, bban);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for "isValid" method.
|
||||
*/
|
||||
function testIsValid() {
|
||||
var iban: string = 'BE68539007547034';
|
||||
var valid: boolean = IBAN.isValid(iban);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for "isValidBBAN" method.
|
||||
*/
|
||||
function testIsValidBBAN() {
|
||||
var countryCode: string = 'fr';
|
||||
var bban: string = 'BBBBBGGGGGCCCCCCCCCCCKK';
|
||||
var valid: boolean = IBAN.isValidBBAN(countryCode, bban);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for "printFormat" method.
|
||||
*/
|
||||
function testPrintFormat() {
|
||||
var iban: string = 'BE68539007547034';
|
||||
var separator: string[] = ['fr'];
|
||||
var format: string = IBAN.printFormat(iban, separator);
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Test for "toBBAN" method.
|
||||
*/
|
||||
function testToBBAN() {
|
||||
var iban: string = 'BE68539007547034';
|
||||
var separator: string[] = ['-'];
|
||||
var bban: string = IBAN.toBBAN(iban, separator);
|
||||
}
|
||||
Vendored
+7
-5
@@ -19,10 +19,11 @@ declare module ARHS {
|
||||
|
||||
/**
|
||||
* @summary Convert the passed BBAN to an IBAN for this country specification.
|
||||
* @param {string} bban The BBAN to convert to IBAN
|
||||
* @returns {string} The IBAN
|
||||
* @param {string} countryCode The country of the BBAN.
|
||||
* @param {string} bban The BBAN to convert to IBAN.
|
||||
* @returns {string} The IBAN.
|
||||
*/
|
||||
fromBBAN(bban: string): string;
|
||||
fromBBAN(countryCode: string, bban: string): string;
|
||||
|
||||
/**
|
||||
* @summary Check if the passed iban is valid according to this specification.
|
||||
@@ -33,10 +34,11 @@ declare module ARHS {
|
||||
|
||||
/**
|
||||
* @summary Check of the passed BBAN is valid.
|
||||
* @param {string} bban The BBAN to validate
|
||||
* @param {string} countryCode The country of the BBAN.
|
||||
* @param {string} bban The BBAN to validate.
|
||||
* @returns {boolean} True if valid, false otherwise.
|
||||
*/
|
||||
isValidBBAN(bban: string): boolean;
|
||||
isValidBBAN(countryCode: string, bban: string): boolean;
|
||||
|
||||
/**
|
||||
* @summary Returns the IBAN in a print format.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
--noImplicitAny
|
||||
Reference in New Issue
Block a user