当前位置: 首页>>代码示例>>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;未经允许,请勿转载。