本文整理匯總了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)
})