Code coverage report for .readme/includes/Exception/ExceptionDocExample.js

Statements: 100% (6 / 6)      Branches: 100% (0 / 0)      Functions: 100% (0 / 0)      Lines: 100% (6 / 6)      Ignored: none     

All files » .readme/includes/Exception/ » ExceptionDocExample.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24  1     1       1         1       1       1    
 
var Exception = Divhide.Exception.Exception;
 
/// the external translation data
var Portuguese = {
    "The maximum value allowed is <%= value %>.": "Valor máximo é <%= value %>."
};
 
var error = new Exception(
    "The maximum value allowed is <%= value %>.",
    { value: 10 });
 
/// Exception instance is an error!
expect(error instanceof Error)
    .equals(true);
 
/// Exception message
expect(error.toString())
    .equals("The maximum value allowed is 10.");
 
/// I18N Exception message
expect(error.toString(Portuguese))
    .equals("Valor máximo é 10.");