本文整理汇总了TypeScript中forms/validation/validators/isClaimReferenceNumber.CheckClaimReferenceNumberConstraint类的典型用法代码示例。如果您正苦于以下问题:TypeScript CheckClaimReferenceNumberConstraint类的具体用法?TypeScript CheckClaimReferenceNumberConstraint怎么用?TypeScript CheckClaimReferenceNumberConstraint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CheckClaimReferenceNumberConstraint类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: describe
describe('CheckClaimReferenceNumberConstraint', () => {
const constraint: CheckClaimReferenceNumberConstraint = new CheckClaimReferenceNumberConstraint()
describe('validate', () => {
describe('should return true when ', () => {
it('given reference is undefined', () => {
expect(constraint.validate(undefined)).to.equal(true)
})
it('given reference is empty space', () => {
expect(constraint.validate('')).to.equal(true)
})
it('given reference is valid CMC claim reference', () => {
expect(constraint.validate('000MC001')).to.equal(true)
})
it('given reference is valid CCBC reference', () => {
expect(constraint.validate('A1QZ1234')).to.equal(true)
})
})
describe('should return false when ', () => {
it('given all numeric reference 1234567', () => {
expect(constraint.validate('1234567')).to.equal(false)
})
it('given a shorter length reference RSAD', () => {
expect(constraint.validate('RSAD')).to.equal(false)
})
it('given a longer length reference 123RD4567', () => {
expect(constraint.validate('123RD4567')).to.equal(false)
})
it('given a reference having invalid format 12RS234', () => {
expect(constraint.validate('12RS234')).to.equal(false)
})
})
})
})
示例2: it
it('given a reference having invalid format 12RS234', () => {
expect(constraint.validate('12RS234')).to.equal(false)
})