本文整理汇总了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)
})
})
示例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)
})
})
示例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))
})
})
})
示例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))
})
})
})
示例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))
})
})
})
示例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))
})
})
})
示例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)
})
})
})
示例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)
})
})
})