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


TypeScript monthlyIncomeType.MonthlyIncomeType類代碼示例

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


在下文中一共展示了MonthlyIncomeType類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: describe

  describe('valueOf', () => {

    it('should return undefined when undefined given', () => {

      const actual: MonthlyIncomeType = MonthlyIncomeType.valueOf(undefined)

      expect(actual).to.be.eq(undefined)
    })

    it('should return undefined when unknown type given', () => {

      const actual: MonthlyIncomeType = MonthlyIncomeType.valueOf('I do not know this type!')

      expect(actual).to.be.eq(undefined)
    })

    MonthlyIncomeType.all().forEach(type => {
      it(`should return valid object for ${type.value}`, () => {

        const actual: MonthlyIncomeType = MonthlyIncomeType.valueOf(type.value)

        expect(actual).to.be.equal(type)
      })
    })
  })
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:25,代碼來源:MonthlyIncomeType.ts

示例2: describe

describe('Income type view filter', () => {
  MonthlyIncomeType.all()
    .forEach(type => {
      it(`should map '${type.value}' to '${type.displayValue}'`, () => {
        expect(IncomeTypeViewFilter.render(type.value)).to.equal(type.displayValue)
      })
    })

  it('should throw an error for anything else', () => {
    expect(() => IncomeTypeViewFilter.render('BANK_ROBBERY')).to.throw(TypeError)
  })

  it('should throw an error for null', () => {
    expect(() => IncomeTypeViewFilter.render(null)).to.throw(TypeError)
  })
})
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:16,代碼來源:income-type-view-filter.ts

示例3: it

    it('should return an array', () => {
      const actual: MonthlyIncomeType[] = MonthlyIncomeType.all()

      expect(actual).instanceof(Array)
      expect(actual.length).to.eq(11)
    })
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:6,代碼來源:MonthlyIncomeType.ts

示例4: render

 export function render (value: string): string {
   return MonthlyIncomeType.valueOf(value).displayValue
 }
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:3,代碼來源:income-type-view-filter.ts


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