/**
  *
  * @covers \DrupalReleaseDate\Sampling\SampleSet
  * @uses \DrupalReleaseDate\Sampling\Sample
  */
 function testGetLastSample()
 {
     $sampleset = new SampleSet();
     $sampleset->insert(new Sample(1, 4));
     $sampleset->insert(new Sample(2, 3));
     $this->assertEquals(2, $sampleset->getLast()->getWhen());
     $sampleset->insert(new Sample(3, 2));
     $sampleset->insert(new Sample(4, 1));
     $this->assertEquals(4, $sampleset->getLast()->getWhen());
 }
 /**
  * Test with a sample set that will never complete and hit the timeout.
  *
  * @expectedException \DrupalReleaseDate\MonteCarlo\TimeoutException
  *
  * @expectedExceptionMessage Run aborted during iteration 1
  *
  * @covers \DrupalReleaseDate\MonteCarlo
  * @uses \DrupalReleaseDate\EstimateDistribution
  * @uses \DrupalReleaseDate\MonteCarlo\TimeoutException<extended>
  * @uses \DrupalReleaseDate\NumberGenerator\Cyclic<extended>
  * @uses \DrupalReleaseDate\Sampling\Sample
  * @uses \DrupalReleaseDate\Sampling\SampleSet
  * @uses \DrupalReleaseDate\Sampling\SampleSetRandomSampleSelector
  */
 public function testTimeoutRun()
 {
     $sampleset = new SampleSet();
     $sampleset->insert(new Sample(10, 10));
     $sampleset->insert(new Sample(20, 10));
     $randomGenerator = new CyclicGenerator(1, $sampleset->length() - 1);
     $sampleSelector = new SampleSetRandomSampleSelector($sampleset, $randomGenerator);
     $montecarlo = new MonteCarlo($sampleSelector);
     $median = $montecarlo->runMedian(100, 10, 5);
 }