Examples of FieldDiffs


Examples of org.sonar.api.issue.internal.FieldDiffs

  @Test
  public void calculate_new_technical_debt_with_null_date() throws Exception {
    Issue issue = new DefaultIssue().setKey("A").setCreationDate(tenDaysAgo).setDebt(twoDaysDebt).setChanges(
      newArrayList(
        new FieldDiffs().setDiff("technicalDebt", oneDay, twoDays).setCreationDate(null)
      )
    );

    assertThat(issueChangelogDebtCalculator.calculateNewTechnicalDebt(issue, null)).isEqualTo(2 * oneDay);
  }
View Full Code Here

Examples of org.sonar.api.issue.internal.FieldDiffs

  @Test
  public void calculate_new_technical_debt_when_new_debt_is_null() throws Exception {
    Issue issue = new DefaultIssue().setKey("A").setCreationDate(tenDaysAgo).setDebt(null).setChanges(
      newArrayList(
        new FieldDiffs().setDiff("technicalDebt", oneDay, null).setCreationDate(null),
        new FieldDiffs().setDiff("technicalDebt", null, oneDay).setCreationDate(nineDaysAgo)
      )
    );

    assertThat(issueChangelogDebtCalculator.calculateNewTechnicalDebt(issue, rightNow)).isNull();
  }
View Full Code Here

Examples of org.sonar.api.issue.internal.FieldDiffs

  @Test
  public void not_return_negative_debt() {
    Issue issue = new DefaultIssue().setKey("A").setCreationDate(tenDaysAgo).setDebt(oneDayDebt).setChanges(
      newArrayList(
        new FieldDiffs().setDiff("technicalDebt", twoDays, oneDay).setCreationDate(null)
      )
    );

    assertThat(issueChangelogDebtCalculator.calculateNewTechnicalDebt(issue, rightNow)).isNull();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.