本文整理匯總了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)
})
})
})