27 lines
773 B
JavaScript
27 lines
773 B
JavaScript
"use strict";
|
|
/**
|
|
* BoundaryValueStrategy — tests values at the edges of expected ranges.
|
|
* Applies to: number, date.
|
|
*/
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.BoundaryValueStrategy = void 0;
|
|
class BoundaryValueStrategy {
|
|
constructor() {
|
|
this.name = 'BoundaryValueStrategy';
|
|
}
|
|
appliesTo(type) {
|
|
return type === 'number' || type === 'date';
|
|
}
|
|
values(type) {
|
|
switch (type) {
|
|
case 'number':
|
|
return ['0', '-1', '2147483647', '2147483648', '-2147483648'];
|
|
case 'date':
|
|
return ['1900-01-01', '2099-12-31', '1970-01-01'];
|
|
default:
|
|
return [];
|
|
}
|
|
}
|
|
}
|
|
exports.BoundaryValueStrategy = BoundaryValueStrategy;
|