Skip to content

Commit

Permalink
Update proliferation module tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicasyu committed Oct 16, 2023
1 parent cf8bd93 commit b844d53
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ void stepG2(MersenneTwisterFast random) {
// Increase size of cell.
cell.updateTarget(cellGrowthRate, SIZE_TARGET);
boolean sizeCheck = cell.getVolume() >= SIZE_CHECKPOINT
* SIZE_TARGET * cell.getCriticalVolume();
* SIZE_TARGET * cell.getCriticalVolume();

// Increase size of nucleus (if cell has regions).
boolean sizeRegionCheck = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public void stepG1_anyTransition_updatesCell() {
module.currentSteps = 0;
module.stepG1(random);

verify(cell, times(2)).updateTarget(module.cellGrowthRate, 2);
verify(cell, times(2)).updateTarget(module.cellGrowthRate, SIZE_TARGET);
}

@Test
Expand All @@ -205,7 +205,7 @@ public void stepG1_anyTransitionWithRegionOverThreshold_updatesCell() {
module.currentSteps = 0;
module.stepG1(random);

verify(cell, times(2)).updateTarget(Region.NUCLEUS, module.nucleusGrowthRate, 2);
verify(cell, times(2)).updateTarget(Region.NUCLEUS, module.nucleusGrowthRate, SIZE_TARGET);
}

@Test
Expand Down Expand Up @@ -288,7 +288,7 @@ public void stepS_anyTransition_updatesCell() {
module.currentSteps = 0;
module.stepS(random);

verify(cell, times(2)).updateTarget(module.cellGrowthRate, 2);
verify(cell, times(2)).updateTarget(module.cellGrowthRate, SIZE_TARGET);
}

@Test
Expand All @@ -307,7 +307,7 @@ public void stepS_anyTransitionWithRegion_updatesCell() {
module.currentSteps = 0;
module.stepS(random);

verify(cell, times(2)).updateTarget(Region.NUCLEUS, module.nucleusGrowthRate, 2);
verify(cell, times(2)).updateTarget(Region.NUCLEUS, module.nucleusGrowthRate, SIZE_TARGET);
}

@Test
Expand Down Expand Up @@ -357,7 +357,7 @@ public void stepG2_withTransitionNotArrested_updatesPhase() {
PottsCell cell = mock(PottsCell.class);
doReturn(parameters).when(cell).getParameters();
double volume = randomDoubleBetween(0, 100);
doReturn((volume * SIZE_CHECKPOINT) + 1).when(cell).getVolume();
doReturn((volume * SIZE_CHECKPOINT * SIZE_TARGET) + 1).when(cell).getVolume();
doReturn(volume).when(cell).getCriticalVolume();

PottsModuleProliferationSimple module = spy(new PottsModuleProliferationSimple(cell));
Expand All @@ -381,7 +381,7 @@ public void stepG2_withoutTransitionNotArrested_maintainsPhase() {
PottsCell cell = mock(PottsCell.class);
doReturn(parameters).when(cell).getParameters();
double volume = randomDoubleBetween(0, 100);
doReturn((volume * SIZE_CHECKPOINT) + 1).when(cell).getVolume();
doReturn((volume * SIZE_CHECKPOINT * SIZE_TARGET) + 1).when(cell).getVolume();
doReturn(volume).when(cell).getCriticalVolume();

PottsModuleProliferationSimple module = spy(new PottsModuleProliferationSimple(cell));
Expand All @@ -406,7 +406,7 @@ public void stepG2_withTransitionArrested_maintainsPhase() {
PottsCell cell = mock(PottsCell.class);
doReturn(parameters).when(cell).getParameters();
double volume = randomDoubleBetween(0, 100);
doReturn((volume * SIZE_CHECKPOINT) - 1).when(cell).getVolume();
doReturn((volume * SIZE_CHECKPOINT * SIZE_TARGET) - 1).when(cell).getVolume();
doReturn(volume).when(cell).getCriticalVolume();

PottsModuleProliferationSimple module = spy(new PottsModuleProliferationSimple(cell));
Expand All @@ -433,11 +433,11 @@ public void stepG2_withTransitionArrestedRegion_maintainsPhase() {
doReturn(true).when(cell).hasRegions();

double volume = randomDoubleBetween(0, 100);
doReturn((volume * SIZE_CHECKPOINT) + 1).when(cell).getVolume();
doReturn((volume * SIZE_CHECKPOINT * SIZE_TARGET) + 1).when(cell).getVolume();
doReturn(volume).when(cell).getCriticalVolume();

double regionVolume = randomDoubleBetween(0, 100);
doReturn((regionVolume * SIZE_CHECKPOINT) - 1).when(cell).getVolume(Region.NUCLEUS);
doReturn((regionVolume * SIZE_CHECKPOINT * SIZE_TARGET) - 1).when(cell).getVolume(Region.NUCLEUS);
doReturn(regionVolume).when(cell).getCriticalVolume(Region.NUCLEUS);

PottsModuleProliferationSimple module = spy(new PottsModuleProliferationSimple(cell));
Expand All @@ -461,7 +461,7 @@ public void stepM_withoutTransitionArrested_maintainPhase() {
PottsCell cell = mock(PottsCell.class);
doReturn(parameters).when(cell).getParameters();
double volume = randomDoubleBetween(0, 100);
doReturn((volume * SIZE_CHECKPOINT) - 1).when(cell).getVolume();
doReturn((volume * SIZE_CHECKPOINT * SIZE_TARGET) - 1).when(cell).getVolume();
doReturn(volume).when(cell).getCriticalVolume();

PottsModuleProliferationSimple module = spy(new PottsModuleProliferationSimple(cell));
Expand Down Expand Up @@ -495,7 +495,7 @@ public void stepG2_anyTransition_updatesCell() {
module.currentSteps = 0;
module.stepG2(random);

verify(cell, times(2)).updateTarget(module.cellGrowthRate, 2);
verify(cell, times(2)).updateTarget(module.cellGrowthRate, SIZE_TARGET);
}

@Test
Expand All @@ -514,7 +514,7 @@ public void stepG2_anyTransitionWithRegion_updatesCell() {
module.currentSteps = 0;
module.stepG2(random);

verify(cell, times(2)).updateTarget(Region.NUCLEUS, module.nucleusGrowthRate, 2);
verify(cell, times(2)).updateTarget(Region.NUCLEUS, module.nucleusGrowthRate, SIZE_TARGET);
}

@Test
Expand Down Expand Up @@ -578,7 +578,7 @@ public void stepM_anyTransition_updatesCell() {
module.currentSteps = 0;
module.stepM(random, simMock);

verify(cell, times(2)).updateTarget(module.cellGrowthRate, 2);
verify(cell, times(2)).updateTarget(module.cellGrowthRate, SIZE_TARGET);
}

@Test
Expand Down

0 comments on commit b844d53

Please sign in to comment.