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


TypeScript YesNoOption.all方法代碼示例

本文整理匯總了TypeScript中models/yesNoOption.YesNoOption.all方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript YesNoOption.all方法的具體用法?TypeScript YesNoOption.all怎麽用?TypeScript YesNoOption.all使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在models/yesNoOption.YesNoOption的用法示例。


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

示例1: it

    it('should accept when recognised option', () => {
      YesNoOption.all().forEach(type => {
        const errors = validator.validateSync(new AcceptCourtOffer(type))

        expect(errors.length).to.equal(0)
      })
    })
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:7,代碼來源:acceptCourtOffer.ts

示例2: it

    it('should accept interest with recognised type', () => {
      YesNoOption.all().forEach(option => {
        const errors = validator.validateSync(new Interest(option))

        expect(errors.length).to.equal(0)
      })
    })
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:7,代碼來源:interest.ts

示例3: describe

  describe('deserialize', () => {
    it('Should return an object with undefined defaults for undefined inputs', () => {
      expect(new PartPaymentReceived().deserialize(undefined)).to.be.deep.equal(new PartPaymentReceived())
    })

    YesNoOption.all().forEach(item => {
      it('Should return a valid instance for the given object', () => {
        expect(new PartPaymentReceived().deserialize({ received: item })).to.be.eql(new PartPaymentReceived(item))
      })
    })
  })
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:11,代碼來源:partPaymentAccepted.ts

示例4: describe

  describe('deserialize', () => {

    it('should return an instance initialised with defaults for undefined', () => {
      expect(new AcceptCourtOffer().deserialize(undefined)).to.be.eql(new AcceptCourtOffer())
    })

    YesNoOption.all().forEach(item => {
      it('should return an instance from given object', () => {
        const actual: AcceptCourtOffer = new AcceptCourtOffer().deserialize({ accept: item })

        expect(actual).to.be.eql(new AcceptCourtOffer(item))
      })
    })

  })
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:15,代碼來源:acceptCourtOffer.ts

示例5: describe

  describe('deserialize', () => {

    it('should return an instance initialised with defaults for undefined', () => {
      expect(new AlreadyPaid().deserialize(undefined)).to.be.eql(new AlreadyPaid())
    })

    YesNoOption.all().forEach(item => {
      it('should return an instance from given object', () => {
        const actual: AlreadyPaid = new AlreadyPaid().deserialize({ option: item.option })

        expect(actual).to.be.eql(new AlreadyPaid(item))
      })
    })

  })
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:15,代碼來源:alreadyPaid.ts

示例6: describe

  describe('deserialize', () => {

    it('should return an instance initialised with defaults for undefined', () => {
      expect(new SettleAdmitted().deserialize(undefined)).to.be.eql(new SettleAdmitted())
    })

    YesNoOption.all().forEach(item => {
      it('should return an instance from given object', () => {
        const actual: SettleAdmitted = new SettleAdmitted().deserialize({ admitted: item })

        expect(actual).to.be.eql(new SettleAdmitted(item))
      })
    })

  })
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:15,代碼來源:settleAdmitted.ts

示例7: describe

  describe('fromObject should return', () => {

    it('undefined when undefined provided', () => {
      const model = ClaimSettled.fromObject(undefined)

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

    it('empty object when unknown value provided', () => {
      const model = ClaimSettled.fromObject({ accepted: 'unknown' })

      expect(model.accepted).to.be.eq(undefined)
    })

    YesNoOption.all().forEach(item => {
      it(`valid object when ${item.option} provided`, () => {
        const model = ClaimSettled.fromObject({ accepted: item.option })

        expect(model.accepted).to.be.eq(item)
      })
    })
  })
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:22,代碼來源:claimSettled.ts

示例8: describe

  describe('fromObject should return', () => {

    it('undefined when undefined provided', () => {
      const model = IntentionToProceed.fromObject(undefined)

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

    it('empty object when unknown value provided', () => {
      const model = IntentionToProceed.fromObject({ admitted: 'I do not know this value!' })

      expect(model.proceed).to.be.eq(undefined)
    })

    YesNoOption.all().forEach(item => {
      it(`valid object when ${item.option} provided`, () => {
        const model = IntentionToProceed.fromObject({ proceed: item.option })

        expect(model.proceed).to.be.eq(item)
      })
    })
  })
開發者ID:hmcts,項目名稱:cmc-citizen-frontend,代碼行數:22,代碼來源:intentionToProceed.ts


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