當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript Simulation.esimatedSocialSecurityAnnual方法代碼示例

本文整理匯總了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);
  });
});
開發者ID:jasoncarreira,項目名稱:choices,代碼行數:32,代碼來源:simulation.spec.ts

示例2: it

 it('should be 20% lower retiring 3 years early ', () => {
   expect(Simulation.esimatedSocialSecurityAnnual(user, 63)).toBeCloseTo(esimatedSocialSecurityAnnual * .8, 2);
 });
開發者ID:jasoncarreira,項目名稱:choices,代碼行數:3,代碼來源:simulation.spec.ts


注:本文中的src/service/simulation.Simulation.esimatedSocialSecurityAnnual方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。