本文整理汇总了TypeScript中src/service/simulation.Simulation.esimatedSocialSecurityAnnual方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Simulation.esimatedSocialSecurityAnnual方法的具体用法?TypeScript Simulation.esimatedSocialSecurityAnnual怎么用?TypeScript Simulation.esimatedSocialSecurityAnnual使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类src/service/simulation.Simulation
的用法示例。
在下文中一共展示了Simulation.esimatedSocialSecurityAnnual方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: describe
describe('The estimated social security ', () => {
let user:User = new User(1, "First", "Last", 56, 66, 40000, []);
let esimatedSocialSecurityAnnual = Simulation.esimatedSocialSecurityAnnual(user, 66);
it('is not null or undefined', () => {
expect(esimatedSocialSecurityAnnual).not.toBeNull();
expect(esimatedSocialSecurityAnnual).not.toBeUndefined();
});
it('should be the same as doing it by hand ', () => {
expect(esimatedSocialSecurityAnnual).toBeCloseTo(18757.76, 2);
});
it('should be 8% higher retiring a year later ', () => {
expect(Simulation.esimatedSocialSecurityAnnual(user, 67)).toBeCloseTo(esimatedSocialSecurityAnnual * 1.08, 2);
});
it('should be 16% higher retiring 2 years later ', () => {
expect(Simulation.esimatedSocialSecurityAnnual(user, 68)).toBeCloseTo(esimatedSocialSecurityAnnual * 1.16, 2);
});
it('should be 24% higher retiring 3 years later ', () => {
expect(Simulation.esimatedSocialSecurityAnnual(user, 69)).toBeCloseTo(esimatedSocialSecurityAnnual * 1.24, 2);
});
it('should be 25% lower retiring at 62 ', () => {
expect(Simulation.esimatedSocialSecurityAnnual(user, 62)).toBeCloseTo(esimatedSocialSecurityAnnual * .75, 2);
});
it('should be 20% lower retiring 3 years early ', () => {
expect(Simulation.esimatedSocialSecurityAnnual(user, 63)).toBeCloseTo(esimatedSocialSecurityAnnual * .8, 2);
});
});
示例2: it
it('should be 20% lower retiring 3 years early ', () => {
expect(Simulation.esimatedSocialSecurityAnnual(user, 63)).toBeCloseTo(esimatedSocialSecurityAnnual * .8, 2);
});