Rename method so it's consistent

FEA: ItEr71S07FragmentationDeletionItEr70S09
This commit is contained in:
Óscar González Fernández 2011-02-22 15:39:36 +01:00
parent 3c8d4e9f49
commit 834d29e887
4 changed files with 12 additions and 12 deletions

View file

@ -79,7 +79,7 @@ public class Capacity {
return allowedExtraEffort == null;
}
public Capacity extraEffort(EffortDuration extraEffort) {
public Capacity withAllowedExtraEffort(EffortDuration extraEffort) {
return new Capacity(standardEffort, extraEffort);
}

View file

@ -399,7 +399,7 @@ public class BaseCalendarTest {
CalendarExceptionType type = createCalendarExceptionType();
calendar.updateExceptionDay(CHRISTMAS_DAY_LOCAL_DATE.plusYears(1),
Capacity.create(hours(8)).extraEffort(
Capacity.create(hours(8)).withAllowedExtraEffort(
type.getCapacity().getAllowedExtraEffort()), type);
assertThat(calendar.getCapacityOn(wholeDay(CHRISTMAS_DAY_LOCAL_DATE
@ -819,7 +819,7 @@ public class BaseCalendarTest {
public void DurationOnRespectsTheExtraEffortPropertyOfCalendarData() {
BaseCalendar calendar = createBasicCalendar();
calendar.setCapacityAt(Days.MONDAY, Capacity.create(hours(8))
.extraEffort(hours(2)));
.withAllowedExtraEffort(hours(2)));
assertThat(calendar.asDurationOn(
PartialDay.wholeDay(MONDAY_LOCAL_DATE),
@ -867,7 +867,7 @@ public class BaseCalendarTest {
public void asDurationOnRespectsCapacityExtraEffort() {
BaseCalendar calendar = createBasicCalendar();
addExceptionOn(calendar, MONDAY_LOCAL_DATE, Capacity.create(hours(2))
.extraEffort(hours(3)));
.withAllowedExtraEffort(hours(3)));
assertThat(calendar.asDurationOn(
PartialDay.wholeDay(MONDAY_LOCAL_DATE),
ResourcesPerDay.amount(1)), equalTo(hours(2)));
@ -883,7 +883,7 @@ public class BaseCalendarTest {
public void canWorkOnRespectsTheCapacityOfTheException() {
BaseCalendar calendar = createBasicCalendar();
addExceptionOn(calendar, MONDAY_LOCAL_DATE, Capacity.create(hours(0))
.extraEffort(hours(0)));
.withAllowedExtraEffort(hours(0)));
assertFalse(calendar.canWorkOn(MONDAY_LOCAL_DATE));
}

View file

@ -39,7 +39,7 @@ public class CapacityTest {
@Test
public void itHasStandardEffortAndAllowedExtraEffort() {
Capacity capacity = Capacity.create(hours(8)).extraEffort(hours(2));
Capacity capacity = Capacity.create(hours(8)).withAllowedExtraEffort(hours(2));
assertThat(capacity.getStandardEffort(),
equalTo(EffortDuration.hours(8)));
assertThat(capacity.getAllowedExtraEffort(), equalTo(hours(2)));
@ -59,14 +59,14 @@ public class CapacityTest {
@Test
public void ifHasAllowedExtraEffortItsNotOverassignableWithoutLimit() {
Capacity capacity = Capacity.create(hours(8)).extraEffort(hours(0));
Capacity capacity = Capacity.create(hours(8)).withAllowedExtraEffort(hours(0));
assertFalse(capacity.isOverAssignableWithoutLimit());
}
@Test
public void hasAnEqualsAndHashCodeBasedOnStandardEffortAndExtraHours() {
Capacity a1 = Capacity.create(hours(8)).extraEffort(hours(2));
Capacity a2 = Capacity.create(hours(8)).extraEffort(hours(2));
Capacity a1 = Capacity.create(hours(8)).withAllowedExtraEffort(hours(2));
Capacity a2 = Capacity.create(hours(8)).withAllowedExtraEffort(hours(2));
Capacity b1 = Capacity.create(hours(8));
@ -100,7 +100,7 @@ public class CapacityTest {
@Test
public void aCapacityWithExtraHoursAndZeroEffortAllowsWorking() {
Capacity capacity = Capacity.create(EffortDuration.zero()).extraEffort(
Capacity capacity = Capacity.create(EffortDuration.zero()).withAllowedExtraEffort(
EffortDuration.minutes(1));
assertTrue(capacity.allowsWorking());
}
@ -131,7 +131,7 @@ public class CapacityTest {
@Test
public void multiplyingMultipliesTheStandardEffortAndTheOverTimeEffort() {
Capacity capacity = Capacity.create(hours(8)).extraEffort(hours(2));
Capacity capacity = Capacity.create(hours(8)).withAllowedExtraEffort(hours(2));
Capacity multiplied = capacity.multiplyBy(2);
assertThat(multiplied.getStandardEffort(), equalTo(hours(16)));
assertThat(multiplied.getAllowedExtraEffort(), equalTo(hours(4)));

View file

@ -96,7 +96,7 @@ public class CapacityPicker {
@Override
public void set(EffortDuration value) {
updateCapacity(currentCapacity.extraEffort(value));
updateCapacity(currentCapacity.withAllowedExtraEffort(value));
}
});
Util.bind(overAssignableWithoutLimitCheckbox, new Getter<Boolean>() {