本文整理汇总了TypeScript中common/court-calculations/courtDecision.CourtDecision类的典型用法代码示例。如果您正苦于以下问题:TypeScript CourtDecision类的具体用法?TypeScript CourtDecision怎么用?TypeScript CourtDecision使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CourtDecision类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should return a court decision type when claimantPaymentDate is before defendantPaymentDate and before the courtGeneratedPaymentDate', () => {
let defendantPaymentDate = moment(new Date()).add(5, 'days')
let claimantPaymentDate = moment(new Date()).add(1, 'days')
let courtGeneratedPaymentDate = moment(new Date()).add(2, 'days')
expect(CourtDecision.calculateDecision(defendantPaymentDate, claimantPaymentDate, courtGeneratedPaymentDate)).to.equal(DecisionType.COURT)
})
示例2: createCourtDecision
static createCourtDecision (claim: Claim, draft: DraftClaimantResponse): DecisionType {
if (claim.response.defendant.isBusiness()) {
return DecisionType.NOT_APPLICABLE_IS_BUSINESS
}
const defendantLastPaymentDate: Moment = CourtDecisionHelper.getDefendantLastPaymentDate(claim)
const claimantLastPaymentDate: Moment = CourtDecisionHelper.getClaimantLastPaymentDate(draft)
const courtOfferedLastDate = CourtDecisionHelper.getCourtOfferedLastDate(claim, draft)
return CourtDecision.calculateDecision(
defendantLastPaymentDate,
claimantLastPaymentDate,
courtOfferedLastDate
)
}
示例3: expect
expect(() => {
let courtGeneratedPaymentDate = moment(new Date())
let defendantPaymentDate = moment(new Date()).add(1, 'days')
CourtDecision.calculateDecision(defendantPaymentDate, null, courtGeneratedPaymentDate)
}).to.throw(Error, 'Input should be a moment, cannot be empty')