本文整理匯總了TypeScript中response/form/models/statement-of-means/priorityDebtType.PriorityDebtType.all方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript PriorityDebtType.all方法的具體用法?TypeScript PriorityDebtType.all怎麽用?TypeScript PriorityDebtType.all使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類response/form/models/statement-of-means/priorityDebtType.PriorityDebtType
的用法示例。
在下文中一共展示了PriorityDebtType.all方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('Should return validation errors for each field that is invalid', () => {
const errors = validator.validateSync(new PriorityDebt(
undefined, new ExpenseSource(PriorityDebtType.MORTGAGE.displayValue, -1, IncomeExpenseSchedule.WEEK),
undefined, new ExpenseSource(PriorityDebtType.RENT.displayValue, -1, IncomeExpenseSchedule.WEEK),
undefined, new ExpenseSource(PriorityDebtType.COUNCIL_TAX_COMMUNITY_CHARGE.displayValue, -1, IncomeExpenseSchedule.WEEK),
undefined, new ExpenseSource(PriorityDebtType.GAS.displayValue, -1, IncomeExpenseSchedule.WEEK),
undefined, new ExpenseSource(PriorityDebtType.ELECTRICITY.displayValue, -1, IncomeExpenseSchedule.WEEK),
undefined, new ExpenseSource(PriorityDebtType.WATER.displayValue, -1, IncomeExpenseSchedule.WEEK),
undefined, new ExpenseSource(PriorityDebtType.MAINTENANCE_PAYMENTS.displayValue, -1, IncomeExpenseSchedule.WEEK)
))
expect(errors.length).to.be.equal(PriorityDebtType.all().length)
PriorityDebtType.all().forEach(value => {
expectValidationError(errors, ValidationErrors.AMOUNT_NON_NEGATIVE_NUMBER_REQUIRED(value.displayValue))
})
})
示例2: describe
describe('Priority debt type view filter', () => {
PriorityDebtType.all()
.forEach(type => {
it(`should map '${type.value}' to '${type.displayValue}'`, () => {
expect(PriorityDebtTypeViewFilter.render(type.value)).to.equal(type.displayValue)
})
})
it('should throw an error for anything else', () => {
expect(() => PriorityDebtTypeViewFilter.render('SHARK_LOAN')).to.throw(Error)
})
it('should throw an error for null', () => {
expect(() => PriorityDebtTypeViewFilter.render(null)).to.throw('Must be a valid priority debt type')
})
})
示例3: describe
describe('value of', () => {
it('should return undefined when given undefined', () => {
expect(PriorityDebtType.valueOf(undefined)).to.be.equal(undefined)
})
it('should return undefined when given unknown type', () => {
expect(PriorityDebtType.valueOf('unknown type test')).to.be.equal(undefined)
})
PriorityDebtType.all().forEach(type => {
it(`should return a valid PriorityDebtType for ${type.value}`, () => {
const actual: PriorityDebtType = PriorityDebtType.valueOf(type.value)
expect(actual.value).to.be.equal(type.value)
})
})
})
示例4: it
it('should return an array with all PriorityDebtTypes', () => {
const actual: PriorityDebtType[] = PriorityDebtType.all()
expect(actual).instanceof(Array)
expect(actual.length).to.be.equal(7)
})