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