當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript priorityDebtType.PriorityDebtType類代碼示例

本文整理匯總了TypeScript中response/form/models/statement-of-means/priorityDebtType.PriorityDebtType的典型用法代碼示例。如果您正苦於以下問題:TypeScript PriorityDebtType類的具體用法?TypeScript PriorityDebtType怎麽用?TypeScript PriorityDebtType使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了PriorityDebtType類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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))
      })
    })
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:16,代碼來源:priorityDebt.ts

示例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')
  })
})
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:16,代碼來源:priority-debt-type-view-filter.ts

示例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)
      })
    })
  })
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:16,代碼來源:priorityDebtType.ts

示例4: render

 export function render (value: string): string {
   if (!value) {
     throw new Error('Must be a valid priority debt type')
   }
   return PriorityDebtType.valueOf(value).displayValue
 }
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:6,代碼來源:priority-debts-type-view-filter.ts

示例5: 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)
    })
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:6,代碼來源:priorityDebtType.ts


注:本文中的response/form/models/statement-of-means/priorityDebtType.PriorityDebtType類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。